# # playbook to setup and configure scrye machines at digitial ocean # - include: "../include/do-create.yml myhosts=aginor.scrye.com" - name: Setup digitial ocean machines hosts: aginor.scrye.com user: root gather_facts: false vars_files: - /home/kevin/git/scrye-ansible/vars/global.yml - /home/kevin/git/scrye-ansible-private/vars.yml handlers: - name: restart iptables service: name=iptables state=restarted pre_tasks: - name: gather facts setup: check_mode: no ignore_errors: True register: facts - name: install python2 and dnf stuff raw: dnf -y install python-dnf libselinux-python when: facts|failed # Now that we can gather facts do so for the last tasks/roles - name: gather facts setup: check_mode: no ignore_errors: True register: facts tasks: - name: correct package setup dnf: state=present name={{ item }} with_items: - zsh - ssmtp - iptables - iptables-services - name: install default iptables for instances template: src={{ files }}/iptables-digitialocean.j2 dest=/etc/sysconfig/iptables notify: - restart iptables tags: - config - iptables - name: setup sstmp copy: src={{ files }}/testmachines/ssmtp.conf dest=/etc/ssmtp/ssmtp.conf owner=root mode=644 tags: - config - ssmtp - name: make sure we only have ssmtp dnf: state=absent name={{ item }} with_items: - sendmail - postfix - exim roles: - dnf-automatic - nsd