--- - hosts: all pre_tasks: - name: Remount / to RW command: mount -uwo noatime / - name: Mount /cfg to RW shell: mount | grep '/cfg' || mount -wo noatime /cfg tasks: - name: Speedtest CLI copy: src=files/speedtest-cli dest=/tools/speedtest-cli owner=root group=wheel mode=0755 - name: WL portal copy: src=files/index.html dest=/usr/local/www/wlportal/index.html owner=root group=wheel mode=0644 - name: Crontab copy: src=files/crontab dest=/conf/base/etc/crontab owner=root group=wheel mode=0644 copy: src=files/crontab dest=/etc/crontab owner=root group=wheel mode=0644 notify: - restart cron - name: Tinyproxy copy: src=files/tinyproxy.conf dest=/conf/base/etc/local/tinyproxy.conf owner=root group=wheel mode=0644 copy: src=files/tinyproxy.conf dest=/usr/local/etc/tinyproxy.conf owner=root group=wheel mode=0644 notify: - restart tinyproxy - name: NTP configuration copy: src=files/ntp.conf dest=/etc/ntp.conf owner=root group=wheel mode=0644 notify: - restart ntpd - name: SSH authorized_keys copy: src=gformat-static/{{ ansible_hostname}}/authorized_keys dest=/cfg/ssh/authorized_keys owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/authorized_keys dest=/etc/ssh/authorized_keys owner=root group=wheel mode=0644 - name: MOTD message copy: src=gformat-static/{{ ansible_hostname}}/motd dest=/cfg/motd owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/motd dest=/etc/motd owner=root group=wheel mode=0644 notify: - restart motd - name: ISC-DHCP configuration copy: src=gformat-static/{{ ansible_hostname}}/dhcpd.conf dest=/cfg/local/dhcpd.conf owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/dhcpd.conf dest=/usr/local/etc/dhcpd.conf owner=root group=wheel mode=0644 notify: - restart isc-dhcpd - name: BIND configuration copy: src=files/named.conf dest=/cfg/namedb/named.conf owner=root group=wheel mode=0644 copy: src=files/named.conf dest=/etc/namedb/named.conf owner=root group=wheel mode=0644 notify: - restart named - include: tasks/nrpe2.yml - name: Interface configuration copy: src=gformat-static/{{ ansible_hostname}}/rc.conf.local dest=/cfg/rc.conf.local owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/rc.conf.local dest=/etc/rc.conf.local owner=root group=wheel mode=0644 #notify: #- restart netif #- restart lvrouted - name: Firewall configuration copy: src=gformat-static/{{ ansible_hostname}}/pf.hybrid.conf.local dest=/cfg/pf.hybrid.conf.local owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/pf.hybrid.conf.local dest=/etc/pf.hybrid.conf.local owner=root group=wheel mode=0644 notify: - restart pf - name: Configuration storage copy: src=gformat-static/{{ ansible_hostname}}/wleiden.yaml dest=/cfg/local/wleiden.yaml owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/wleiden.yaml dest=/usr/local/etc/wleiden.yaml owner=root group=wheel mode=0644 notify: - restart pf - name: Resolv configuration copy: src=gformat-static/{{ ansible_hostname}}/resolv.conf dest=/cfg/resolv.conf owner=root group=wheel mode=0644 copy: src=gformat-static/{{ ansible_hostname}}/resolv.conf dest=/etc/resolv.conf owner=root group=wheel mode=0644 - name: Services started service: name={{ item }} state=started with_items: - thttpd - nrpe2 - lvrouted - snmpd - pen post_tasks: - name: Remount / to RO command: mount -ur / - name: Unmount /cfg command: umount /cfg handlers: - name: restart ntpd service: name=ntpd state=restarted - name: restart isc-dhcpd service: name=isc-dhcpd state=restarted - name: restart motd service: name=motd state=restarted - name: restart named service: name=named state=restarted - name: restart netif service: name=netif state=restarted - name: restart lvrouted service: name=lvrouted state=restarted - name: restart pf service: name=pf state=restarted - name: restart tinyproxy service: name=tinyproxy state=restarted - name: restart cron service: name=cron state=restarted - name: kill nrpe2 command: killall -KILL nrpe2 ignore_errors: yes - name: restart nrpe2 service: name=nrpe2 state=restarted