diff options
Diffstat (limited to 'roles/install_fastd/tasks')
-rw-r--r-- | roles/install_fastd/tasks/main.yml | 63 |
1 files changed, 22 insertions, 41 deletions
diff --git a/roles/install_fastd/tasks/main.yml b/roles/install_fastd/tasks/main.yml index 4a0a131..8f01e47 100644 --- a/roles/install_fastd/tasks/main.yml +++ b/roles/install_fastd/tasks/main.yml @@ -6,77 +6,58 @@ name: fastd tool: yaourt -- name: create ffmyk folder +- name: create site folder file: - path: /etc/fastd/ffmyk + path: /etc/fastd/ff{{ item.name }} state: directory + with_items: "{{ sites }}" - name: fastd.conf template: src: fastd.conf.j2 - dest: /etc/fastd/ffmyk/fastd.conf + dest: /etc/fastd/ff{{ item.name }}/fastd.conf mode: 0640 - notify: restart fastd - -- name: create backbone folder - file: - path: /etc/fastd/ffmyk/backbone - state: directory - -- name: add backbone peers - copy: - src: '{{ item }}' - dest: /etc/fastd/ffmyk/backbone/{{ item }} - with_items: - - fastd1 - - fastd2 - - fastd3 - - fastd4 - - fastd5 - - fastd6 - - fastd7 - - fastd8 - - fastd9 - - fastd10 - - fastd11 - - fastd12 - - fastd13 - - fastd14 - - fastd15 - notify: reload fastd + notify: restart fastd{{ item.name }} + with_items: "{{ sites }}" - name: add fastd bin folder file: - path: /etc/fastd/ffmyk/bin + path: /etc/fastd/ff{{ item.name }}/bin state: directory + with_items: "{{ sites }}" - name: add fastd up script template: src: fastd_up.sh.j2 - dest: /etc/fastd/ffmyk/bin/up.sh + dest: /etc/fastd/ff{{ item.name }}/bin/up.sh mode: 0744 - notify: restart fastd + notify: restart fastd{{ item.name }} + with_items: "{{ sites }}" - name: add fastd peers folder file: - path: /etc/fastd/ffmyk/peers + path: /etc/fastd/ff{{ item.name }}/peers state: directory + with_items: "{{ sites }}" - name: add fastd peer api script - copy: - src: fastd-api.php - dest: /etc/fastd/ffmyk/bin/fastd-api.php + template: + src: fastd-api.php.j2 + dest: /etc/fastd/ff{{ item.name }}/bin/fastd-api.php + with_items: "{{ sites }}" - name: setup cronjob for fastd-api cron: - name: fastd-api + name: fastd-api-{{ item.name }} minute: '*/10' user: root cron_file: fastd-api - job: '/usr/bin/php /etc/fastd/ffmyk/bin/fastd-api.php' + job: '/usr/bin/php /etc/fastd/ff{{ item.name }}/bin/fastd-api.php' + with_items: "{{ sites }}" - name: start and enable fastd service systemd: - name: fastd@ffmyk.service + name: fastd@ff{{ item.name }}.service enabled: yes state: started + with_items: "{{ sites }}" |