- name: Create sentinel directory file: state: directory path: "{{ item }}/sentinel" with_items: - /usr/local/bin - /etc vars: ansible_become: yes ansible_become_method: sudo ansible_become_password: "{{ sudo_password }}" when: script is not defined - name: Template virtualhost template: src: virtualhost.j2 dest: /etc/sentinel/virtualhost mode: "0444" vars: ansible_become: yes ansible_become_method: sudo ansible_become_password: "{{ sudo_password }}" when: script is not defined or script == "blacklist" - name: Copy blacklist copy: src: "{{ playbook_dir }}/blacklist/{{ inventory_hostname }}/etc/sentinel/blacklist" dest: /etc/sentinel/blacklist mode: "0644" when: script is not defined or script == "blacklist" ignore_errors: true vars: ansible_become: yes ansible_become_method: sudo ansible_become_password: "{{ sudo_password }}" tags: [ "restore" ] - name: Deploy stats script import_tasks: stats.yml when: script is not defined or script == "stats" - name: Configure blacklist script import_tasks: blacklist.yml when: script is not defined or script == "blacklist" - name: Configure supervision script import_tasks: supervision.yml when: script is not defined or script == "supervision"