mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
'| bool' for Ansible 2.8; prep U18+
This commit is contained in:
parent
2ea775848a
commit
3eccbd9d60
15 changed files with 34 additions and 33 deletions
|
@ -3,7 +3,7 @@
|
||||||
name: avahi
|
name: avahi
|
||||||
createhome: no
|
createhome: no
|
||||||
shell: /bin/false
|
shell: /bin/false
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Install avahi announce config file /etc/avahi/services/schoolserver.service
|
- name: Install avahi announce config file /etc/avahi/services/schoolserver.service
|
||||||
template:
|
template:
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
copy:
|
copy:
|
||||||
src: /usr/share/doc/avahi-daemon/examples/ssh.service
|
src: /usr/share/doc/avahi-daemon/examples/ssh.service
|
||||||
dest: /etc/avahi/services/
|
dest: /etc/avahi/services/
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Set ssh port for avahi
|
- name: Set ssh port for avahi
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
- name: Checking iiab_wan_enabled
|
- name: Checking iiab_wan_enabled
|
||||||
set_fact:
|
set_fact:
|
||||||
user_wan_iface: "none"
|
user_wan_iface: "none"
|
||||||
when: 'not iiab_wan_enabled'
|
when: not iiab_wan_enabled
|
||||||
|
|
||||||
# gui wants LanController # keeps ifcfg-WAN but onboot=no
|
# gui wants LanController # keeps ifcfg-WAN but onboot=no
|
||||||
# the change over might be a little bumpy ATM.
|
# the change over might be a little bumpy ATM.
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
iiab_lan_iface: "br0"
|
iiab_lan_iface: "br0"
|
||||||
iiab_wireless_lan_iface: "wlan0"
|
iiab_wireless_lan_iface: "wlan0"
|
||||||
when: is_rpi
|
when: is_rpi | bool
|
||||||
|
|
||||||
- name: Enable hostapd if discovered_wireless_iface is not WAN
|
- name: Enable hostapd if discovered_wireless_iface is not WAN
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
owner: dansguardian
|
owner: dansguardian
|
||||||
group: dansguardian
|
group: dansguardian
|
||||||
mode: 0640
|
mode: 0640
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Install /etc/dansguardian/dansguardian.conf from template (CentOS)
|
- name: Install /etc/dansguardian/dansguardian.conf from template (CentOS)
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -73,13 +73,13 @@
|
||||||
service:
|
service:
|
||||||
name: dhcpd
|
name: dhcpd
|
||||||
state: stopped
|
state: stopped
|
||||||
when: dhcpd_install
|
when: dhcpd_install | bool
|
||||||
|
|
||||||
- name: dhcpd_server may be affected - stopping dnsmasq
|
- name: dhcpd_server may be affected - stopping dnsmasq
|
||||||
service:
|
service:
|
||||||
name: dnsmasq
|
name: dnsmasq
|
||||||
state: stopped
|
state: stopped
|
||||||
when: dnsmasq_install
|
when: dnsmasq_install | bool
|
||||||
|
|
||||||
- name: Reload systemd
|
- name: Reload systemd
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
- name: Red Hat network detection (redhat)
|
- name: Red Hat network detection (redhat)
|
||||||
include_tasks: detected_redhat.yml
|
include_tasks: detected_redhat.yml
|
||||||
when: is_redhat
|
when: is_redhat | bool
|
||||||
|
|
||||||
- name: Setting dhcpcd_test results
|
- name: Setting dhcpcd_test results
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
- name: Check /etc/network/interfaces for gateway
|
- name: Check /etc/network/interfaces for gateway
|
||||||
shell: grep {{ device_gw }} /etc/network/interfaces | wc -l
|
shell: grep {{ device_gw }} /etc/network/interfaces | wc -l
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
register: wan_file
|
register: wan_file
|
||||||
|
|
||||||
- name: Setting wan_in_interfaces
|
- name: Setting wan_in_interfaces
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package:
|
package:
|
||||||
name: isc-dhcp-server
|
name: isc-dhcp-server
|
||||||
state: present
|
state: present
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
|
@ -18,21 +18,21 @@
|
||||||
user:
|
user:
|
||||||
name: dhcpd
|
name: dhcpd
|
||||||
createhome: no
|
createhome: no
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Disable stock dhcp_service (debuntu)
|
- name: Disable stock dhcp_service (debuntu)
|
||||||
service:
|
service:
|
||||||
name: "{{ dhcp_service }}"
|
name: "{{ dhcp_service }}"
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Disable stock dhcp_service ipv6 (ubuntu-18)
|
- name: Disable stock dhcp_service ipv6 (ubuntu-18 and higher)
|
||||||
service:
|
service:
|
||||||
name: "{{ dhcp_service }}6"
|
name: "{{ dhcp_service }}6"
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
when: is_ubuntu_18
|
when: is_ubuntu and not is_ubuntu_16
|
||||||
|
|
||||||
- name: Install systemd unit file to /etc/systemd/system/dhcpd.service
|
- name: Install systemd unit file to /etc/systemd/system/dhcpd.service
|
||||||
template:
|
template:
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
command: touch /var/lib/dhcpd/dhcpd.leases
|
command: touch /var/lib/dhcpd/dhcpd.leases
|
||||||
args:
|
args:
|
||||||
creates: /var/lib/dhcpd/dhcpd.leases
|
creates: /var/lib/dhcpd/dhcpd.leases
|
||||||
when: is_redhat
|
when: is_redhat | bool
|
||||||
|
|
||||||
- name: Set dhcpd.leases permissions/ownership (redhat)
|
- name: Set dhcpd.leases permissions/ownership (redhat)
|
||||||
file:
|
file:
|
||||||
|
@ -57,4 +57,4 @@
|
||||||
group: dhcpd
|
group: dhcpd
|
||||||
mode: 0644
|
mode: 0644
|
||||||
state: file
|
state: file
|
||||||
when: is_redhat
|
when: is_redhat | bool
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
service:
|
service:
|
||||||
name: dhcpd
|
name: dhcpd
|
||||||
state: stopped
|
state: stopped
|
||||||
when: dhcpd_install
|
when: dhcpd_install | bool
|
||||||
|
|
||||||
- name: dhcpd_server may be affected - stopping dnsmasq
|
- name: dhcpd_server may be affected - stopping dnsmasq
|
||||||
service:
|
service:
|
||||||
name: dnsmasq
|
name: dnsmasq
|
||||||
state: stopped
|
state: stopped
|
||||||
when: dnsmasq_install
|
when: dnsmasq_install | bool
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: is_rpi
|
when: is_rpi | bool
|
||||||
|
|
||||||
- name: Create /usr/bin/iiab-hotspot-off from template
|
- name: Create /usr/bin/iiab-hotspot-off from template
|
||||||
template:
|
template:
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: is_rpi
|
when: is_rpi | bool
|
||||||
|
|
||||||
- name: Disable the Access Point 'hostapd' service
|
- name: Disable the Access Point 'hostapd' service
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -36,13 +36,13 @@
|
||||||
service:
|
service:
|
||||||
name: dhcpd
|
name: dhcpd
|
||||||
state: stopped
|
state: stopped
|
||||||
when: dhcpd_install
|
when: dhcpd_install | bool
|
||||||
|
|
||||||
- name: dhcpd_server may be affected - stopping dnsmasq
|
- name: dhcpd_server may be affected - stopping dnsmasq
|
||||||
service:
|
service:
|
||||||
name: dnsmasq
|
name: dnsmasq
|
||||||
state: stopped
|
state: stopped
|
||||||
when: dnsmasq_install
|
when: dnsmasq_install | bool
|
||||||
|
|
||||||
- name: Stop the LAN/Bridge deleting iiab-LAN
|
- name: Stop the LAN/Bridge deleting iiab-LAN
|
||||||
shell: nmcli con delete id iiab-LAN
|
shell: nmcli con delete id iiab-LAN
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
- name: Configure wondershaper
|
- name: Configure wondershaper
|
||||||
include_tasks: wondershaper.yml
|
include_tasks: wondershaper.yml
|
||||||
when: wondershaper_install
|
when: wondershaper_install | bool
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
- wondershaper
|
- wondershaper
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
#### Start network layout
|
#### Start network layout
|
||||||
- name: Redhat networking
|
- name: Redhat networking
|
||||||
include_tasks: ifcfg_mods.yml
|
include_tasks: ifcfg_mods.yml
|
||||||
when: is_redhat
|
when: is_redhat | bool
|
||||||
#and not installing
|
#and not installing
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
- bind9
|
- bind9
|
||||||
- bind9utils
|
- bind9utils
|
||||||
state: present
|
state: present
|
||||||
when: is_debuntu
|
when: is_debuntu | bool
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
template:
|
template:
|
||||||
src: roles/network/templates/named/dns-jail.conf
|
src: roles/network/templates/named/dns-jail.conf
|
||||||
dest: "/etc/{{ apache_config_dir }}/"
|
dest: "/etc/{{ apache_config_dir }}/"
|
||||||
when: dns_jail_enabled
|
when: dns_jail_enabled | bool
|
||||||
|
|
||||||
- name: Create symlink dns-jail.conf from sites-enabled to sites-available (if debuntu and dns_jail_enabled)
|
- name: Create symlink dns-jail.conf from sites-enabled to sites-available (if debuntu and dns_jail_enabled)
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
enabled: yes
|
enabled: yes
|
||||||
with_items:
|
with_items:
|
||||||
- systemd-networkd-wait-online
|
- systemd-networkd-wait-online
|
||||||
when: systemd_networkd_active
|
when: systemd_networkd_active | bool
|
||||||
|
|
||||||
# ICO will always set gui_static_wan_ip away from the default of 'unset' while
|
# ICO will always set gui_static_wan_ip away from the default of 'unset' while
|
||||||
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
|
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
shell: nmcli conn up id iiab-WAN
|
shell: nmcli conn up id iiab-WAN
|
||||||
register: dhcp_WAN
|
register: dhcp_WAN
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
when: has_WAN
|
when: has_WAN | bool
|
||||||
|
|
||||||
- name: BAD ifcfg-WAN
|
- name: BAD ifcfg-WAN
|
||||||
debug:
|
debug:
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
register: ifcfg_dhcp_device
|
register: ifcfg_dhcp_device
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
changed_when: False
|
changed_when: False
|
||||||
when: dhcp_good
|
when: dhcp_good | bool
|
||||||
|
|
||||||
- name: Setting has ifcfg gw based on device if found
|
- name: Setting has ifcfg gw based on device if found
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
- name: "Bigger hammer for Ubuntu, run: /etc/init.d/squid stop"
|
- name: "Bigger hammer for Ubuntu, run: /etc/init.d/squid stop"
|
||||||
command: /etc/init.d/squid stop
|
command: /etc/init.d/squid stop
|
||||||
when: is_ubuntu
|
when: is_ubuntu | bool
|
||||||
|
|
||||||
- name: Stop Squid
|
- name: Stop Squid
|
||||||
service:
|
service:
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- include_tasks: roles/network/tasks/dansguardian.yml
|
- include_tasks: roles/network/tasks/dansguardian.yml
|
||||||
when: dansguardian_install
|
when: dansguardian_install | bool
|
||||||
|
|
||||||
# {{ proxy }} is normally "squid", but is "squid3" on raspbian-8 & debian-8
|
# {{ proxy }} is normally "squid", but is "squid3" on raspbian-8 & debian-8
|
||||||
- name: Add '{{ proxy }}' variable values to {{ iiab_ini_file }}
|
- name: Add '{{ proxy }}' variable values to {{ iiab_ini_file }}
|
||||||
|
|
|
@ -33,11 +33,12 @@
|
||||||
wan_cidr: "{{ CIDR.stdout }}"
|
wan_cidr: "{{ CIDR.stdout }}"
|
||||||
when: wan_ip != "dhcp"
|
when: wan_ip != "dhcp"
|
||||||
|
|
||||||
- name: Supply static WAN template
|
- name: Supply static WAN template (ubuntu-16)
|
||||||
template:
|
template:
|
||||||
dest: /etc/systemd/network/IIAB-Static.network
|
dest: /etc/systemd/network/IIAB-Static.network
|
||||||
src: network/systemd-static-net.j2
|
src: network/systemd-static-net.j2
|
||||||
when: wan_ip != "dhcp" and not is_ubuntu_18
|
when: wan_ip != "dhcp" and is_ubuntu_16
|
||||||
|
#when: wan_ip != "dhcp" and not is_ubuntu_18
|
||||||
|
|
||||||
- name: Stopping services
|
- name: Stopping services
|
||||||
include_tasks: down-debian.yml
|
include_tasks: down-debian.yml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue