You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ffmyk-ansible/roles/install_fastd/tasks/main.yml

62 lines
1.4 KiB
YAML

---
- name: install fastd
pacman:
name: fastd
state: present
8 years ago
- name: create site folder
file:
8 years ago
path: /etc/fastd/ff{{ item.name }}
state: directory
8 years ago
with_items: "{{ sites }}"
- name: fastd.conf
template:
src: fastd.conf.j2
8 years ago
dest: /etc/fastd/ff{{ item.name }}/fastd.conf
mode: 0640
8 years ago
notify: restart fastd{{ item.name }}
with_items: "{{ sites }}"
- name: add fastd bin folder
file:
8 years ago
path: /etc/fastd/ff{{ item.name }}/bin
state: directory
8 years ago
with_items: "{{ sites }}"
- name: add fastd up script
template:
src: fastd_up.sh.j2
8 years ago
dest: /etc/fastd/ff{{ item.name }}/bin/up.sh
mode: 0744
8 years ago
notify: restart fastd{{ item.name }}
with_items: "{{ sites }}"
- name: add fastd peers folder
file:
8 years ago
path: /etc/fastd/ff{{ item.name }}/peers
state: directory
8 years ago
with_items: "{{ sites }}"
- name: add fastd peer api script
8 years ago
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:
8 years ago
name: fastd-api-{{ item.name }}
minute: '*/10'
user: root
cron_file: fastd-api
8 years ago
job: '/usr/bin/php /etc/fastd/ff{{ item.name }}/bin/fastd-api.php'
with_items: "{{ sites }}"
- name: start and enable fastd service
systemd:
8 years ago
name: fastd@ff{{ item.name }}.service
enabled: yes
state: started
8 years ago
with_items: "{{ sites }}"