Skip to content

Commit

Permalink
Fix case of handlers name in tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
martignoni committed Sep 11, 2022
1 parent b51ec60 commit 112bcc0
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 24 deletions.
15 changes: 10 additions & 5 deletions roles/accesspoint/tasks/main.yml
Expand Up @@ -23,21 +23,24 @@
interface {{ moodlebox_wifi_ap_interface }}
static ip_address={{ moodlebox_ip_address | ansible.utils.ipaddr('host') }}
nohook wpa_supplicant
notify: restart networking
notify:
- Restart networking

- name: Update access point configuration file
ansible.builtin.template:
src: 'etc/hostapd/hostapd.conf.j2'
dest: '/etc/hostapd/hostapd.conf'
mode: '0644'
notify: restart networking
notify:
- Restart networking

- name: Update access point settings
ansible.builtin.lineinfile:
path: '/etc/default/hostapd'
regexp: '^#?DAEMON_CONF'
line: 'DAEMON_CONF="/etc/hostapd/hostapd.conf"'
notify: restart networking
notify:
- Restart networking

- name: Unmask, enable and start hostapd
ansible.builtin.systemd:
Expand All @@ -51,7 +54,8 @@
src: 'etc/dnsmasq.conf.j2'
dest: '/etc/dnsmasq.conf'
mode: '0664'
notify: restart networking
notify:
- Restart networking

- name: Update dnsmasq service file
ansible.builtin.blockinfile:
Expand All @@ -60,7 +64,8 @@
block: |
RestartSec=5
Restart=on-failure
notify: restart networking
notify:
- Restart networking

- name: Flush handlers
ansible.builtin.meta: flush_handlers
6 changes: 4 additions & 2 deletions roles/hostname/tasks/main.yml
Expand Up @@ -3,12 +3,14 @@
- name: Change hostname to '{{ moodlebox_hostname }}'
ansible.builtin.hostname:
name: '{{ moodlebox_hostname }}'
notify: restart networking
notify:
- Restart networking

- name: Change /etc/hosts
ansible.builtin.template:
src: 'etc/hosts.j2'
dest: '/etc/hosts'
mode: '0644'
when: ansible_hostname == moodlebox_hostname
notify: restart networking
notify:
- Restart networking
3 changes: 2 additions & 1 deletion roles/ipforwarding/tasks/main.yml
Expand Up @@ -13,7 +13,8 @@
src: 'etc/iptables/rules.v4.j2'
dest: '/etc/iptables/rules.v4'
mode: '0644'
notify: restart networking
notify:
- Restart networking

- name: Flush handlers
ansible.builtin.meta: flush_handlers
3 changes: 2 additions & 1 deletion roles/moodleuninstall/tasks/main.yml
Expand Up @@ -5,7 +5,8 @@
register: moodle_db_exists
failed_when: moodle_db_exists.rc > 0
changed_when: moodle_db_exists.stdout | length > 0
notify: drop database for Moodle
notify:
- Drop database for Moodle

- name: Remove temporary storage for Moodle cache
ansible.posix.mount:
Expand Down
18 changes: 12 additions & 6 deletions roles/packageconfig/tasks/main.yml
Expand Up @@ -68,42 +68,48 @@
with_items:
- '/lib/systemd/system/nginx.service'
- '/lib/systemd/system/php7.4-fpm.service'
notify: restart web services
notify:
- Restart web services

- name: Set 'group' of php-fpm process
ansible.builtin.lineinfile:
path: '/etc/php/7.4/fpm/pool.d/www.conf'
regexp: '^group\s*=\s*www-data.*'
line: 'group = {{ moodlebox_username }}'
notify: restart web services
notify:
- Restart web services

- name: Set 'pm.max_requests' of php-fpm process
ansible.builtin.lineinfile:
path: '/etc/php/7.4/fpm/pool.d/www.conf'
regexp: '^;?pm.max_requests\s*=.*'
line: 'pm.max_requests = 50'
notify: restart web services
notify:
- Restart web services

- name: Set 'emergency_restart_threshold' for php-fpm to fix potential SIGSEGV
ansible.builtin.lineinfile:
path: '/etc/php/7.4/fpm/php-fpm.conf'
regexp: '^;?emergency_restart_threshold\s*=.*'
line: 'emergency_restart_threshold = 2'
notify: restart web services
notify:
- Restart web services

- name: Set 'emergency_restart_interval' for php-fpm to fix potential SIGSEGV
ansible.builtin.lineinfile:
path: '/etc/php/7.4/fpm/php-fpm.conf'
regexp: '^;?emergency_restart_interval\s*=.*'
line: 'emergency_restart_interval = 1h'
notify: restart web services
notify:
- Restart web services

- name: Set 'process_control_timeout' for php-fpm to fix potential SIGSEGV
ansible.builtin.lineinfile:
path: '/etc/php/7.4/fpm/php-fpm.conf'
regexp: '^;?process_control_timeout\s*=.*'
line: 'process_control_timeout = 5s'
notify: restart web services
notify:
- Restart web services

- name: Flush handlers
ansible.builtin.meta: flush_handlers
6 changes: 3 additions & 3 deletions roles/rpisettings/tasks/main.yml
Expand Up @@ -7,23 +7,23 @@
insertafter: '^\[all\]'
firstmatch: true
notify:
- reboot box
- Reboot box

- name: Enable shutdown/startup hardware button
ansible.builtin.lineinfile:
path: '/boot/config.txt'
line: 'dtoverlay=gpio-shutdown'
insertafter: '^# Additional overlays and parameters'
notify:
- reboot box
- Reboot box

- name: Copy udev rule to add wireless interface for AP mode
ansible.builtin.template:
src: 'etc/udev/rules.d/90-wireless.rules.j2'
dest: '/etc/udev/rules.d/90-wireless.rules'
mode: '0644'
notify:
- reboot box
- Reboot box

- name: Flush handlers
ansible.builtin.meta: flush_handlers
3 changes: 2 additions & 1 deletion roles/timezone/tasks/main.yml
Expand Up @@ -6,7 +6,8 @@
path: '/etc/localtime'
state: 'link'
register: timezone_status
notify: update tzdata
notify:
- Update tzdata

- name: Flush handlers
ansible.builtin.meta: flush_handlers
6 changes: 4 additions & 2 deletions roles/webserver/tasks/main.yml
Expand Up @@ -5,14 +5,16 @@
src: 'etc/nginx/sites-available/default.j2'
dest: '/etc/nginx/sites-available/default'
mode: '0644'
notify: restart web services
notify:
- Restart web services

- name: Copy SSL certificate and key
ansible.builtin.copy:
src: 'etc/nginx/ssl'
dest: '/etc/nginx/'
mode: '0644'
notify: restart web services
notify:
- Restart web services

- name: Flush handlers
ansible.builtin.meta: flush_handlers
6 changes: 4 additions & 2 deletions roles/wifi/tasks/main.yml
Expand Up @@ -5,7 +5,8 @@
src: 'etc/wpa_supplicant/wpa_supplicant.conf.j2'
dest: '/etc/wpa_supplicant/wpa_supplicant.conf'
mode: '0644'
notify: restart networking
notify:
- Restart networking

- name: Unblock wifi, since wifi country is set
ansible.builtin.copy:
Expand All @@ -15,7 +16,8 @@
with_items:
- '/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan'
- '/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan'
notify: restart networking
notify:
- Restart networking

- name: Disable unused wpa_supplicant service
ansible.builtin.systemd:
Expand Down
3 changes: 2 additions & 1 deletion roles/zeroconf/tasks/main.yml
Expand Up @@ -6,7 +6,8 @@
dest: '/etc/avahi/services/{{ moodlebox_hostname }}.service'
mode: '0644'
register: network_configured
notify: restart networking
notify:
- Restart networking

- name: Flush handlers
ansible.builtin.meta: flush_handlers

0 comments on commit 112bcc0

Please sign in to comment.