1
0
Fork 0
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:
holta 2019-05-24 03:06:43 -04:00
parent 2ea775848a
commit 3eccbd9d60
15 changed files with 34 additions and 33 deletions

View file

@ -3,7 +3,7 @@
name: avahi
createhome: no
shell: /bin/false
when: is_debuntu
when: is_debuntu | bool
- name: Install avahi announce config file /etc/avahi/services/schoolserver.service
template:
@ -37,7 +37,7 @@
copy:
src: /usr/share/doc/avahi-daemon/examples/ssh.service
dest: /etc/avahi/services/
when: is_debuntu
when: is_debuntu | bool
- name: Set ssh port for avahi
lineinfile:

View file

@ -60,7 +60,7 @@
- name: Checking iiab_wan_enabled
set_fact:
user_wan_iface: "none"
when: 'not iiab_wan_enabled'
when: not iiab_wan_enabled
# gui wants LanController # keeps ifcfg-WAN but onboot=no
# the change over might be a little bumpy ATM.
@ -141,7 +141,7 @@
set_fact:
iiab_lan_iface: "br0"
iiab_wireless_lan_iface: "wlan0"
when: is_rpi
when: is_rpi | bool
- name: Enable hostapd if discovered_wireless_iface is not WAN
set_fact:

View file

@ -21,7 +21,7 @@
owner: dansguardian
group: dansguardian
mode: 0640
when: is_debuntu
when: is_debuntu | bool
- name: Install /etc/dansguardian/dansguardian.conf from template (CentOS)
template:

View file

@ -73,13 +73,13 @@
service:
name: dhcpd
state: stopped
when: dhcpd_install
when: dhcpd_install | bool
- name: dhcpd_server may be affected - stopping dnsmasq
service:
name: dnsmasq
state: stopped
when: dnsmasq_install
when: dnsmasq_install | bool
- name: Reload systemd
systemd:

View file

@ -17,7 +17,7 @@
- name: Red Hat network detection (redhat)
include_tasks: detected_redhat.yml
when: is_redhat
when: is_redhat | bool
- name: Setting dhcpcd_test results
set_fact:
@ -40,7 +40,7 @@
- name: Check /etc/network/interfaces for gateway
shell: grep {{ device_gw }} /etc/network/interfaces | wc -l
when: is_debuntu
when: is_debuntu | bool
register: wan_file
- name: Setting wan_in_interfaces

View file

@ -2,7 +2,7 @@
package:
name: isc-dhcp-server
state: present
when: is_debuntu
when: is_debuntu | bool
tags:
- download
@ -18,21 +18,21 @@
user:
name: dhcpd
createhome: no
when: is_debuntu
when: is_debuntu | bool
- name: Disable stock dhcp_service (debuntu)
service:
name: "{{ dhcp_service }}"
enabled: no
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:
name: "{{ dhcp_service }}6"
enabled: no
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
template:
@ -48,7 +48,7 @@
command: touch /var/lib/dhcpd/dhcpd.leases
args:
creates: /var/lib/dhcpd/dhcpd.leases
when: is_redhat
when: is_redhat | bool
- name: Set dhcpd.leases permissions/ownership (redhat)
file:
@ -57,4 +57,4 @@
group: dhcpd
mode: 0644
state: file
when: is_redhat
when: is_redhat | bool

View file

@ -16,10 +16,10 @@
service:
name: dhcpd
state: stopped
when: dhcpd_install
when: dhcpd_install | bool
- name: dhcpd_server may be affected - stopping dnsmasq
service:
name: dnsmasq
state: stopped
when: dnsmasq_install
when: dnsmasq_install | bool

View file

@ -31,7 +31,7 @@
owner: root
group: root
mode: 0755
when: is_rpi
when: is_rpi | bool
- name: Create /usr/bin/iiab-hotspot-off from template
template:
@ -40,7 +40,7 @@
owner: root
group: root
mode: 0755
when: is_rpi
when: is_rpi | bool
- name: Disable the Access Point 'hostapd' service
systemd:

View file

@ -36,13 +36,13 @@
service:
name: dhcpd
state: stopped
when: dhcpd_install
when: dhcpd_install | bool
- name: dhcpd_server may be affected - stopping dnsmasq
service:
name: dnsmasq
state: stopped
when: dnsmasq_install
when: dnsmasq_install | bool
- name: Stop the LAN/Bridge deleting iiab-LAN
shell: nmcli con delete id iiab-LAN

View file

@ -57,7 +57,7 @@
- name: Configure wondershaper
include_tasks: wondershaper.yml
when: wondershaper_install
when: wondershaper_install | bool
tags:
- network
- wondershaper
@ -99,7 +99,7 @@
#### Start network layout
- name: Redhat networking
include_tasks: ifcfg_mods.yml
when: is_redhat
when: is_redhat | bool
#and not installing
tags:
- network

View file

@ -4,7 +4,7 @@
- bind9
- bind9utils
state: present
when: is_debuntu
when: is_debuntu | bool
tags:
- download
@ -79,7 +79,7 @@
template:
src: roles/network/templates/named/dns-jail.conf
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)
file:

View file

@ -27,7 +27,7 @@
enabled: yes
with_items:
- 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
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and

View file

@ -57,7 +57,7 @@
shell: nmcli conn up id iiab-WAN
register: dhcp_WAN
ignore_errors: yes
when: has_WAN
when: has_WAN | bool
- name: BAD ifcfg-WAN
debug:
@ -117,7 +117,7 @@
register: ifcfg_dhcp_device
ignore_errors: True
changed_when: False
when: dhcp_good
when: dhcp_good | bool
- name: Setting has ifcfg gw based on device if found
set_fact:

View file

@ -9,7 +9,7 @@
- name: "Bigger hammer for Ubuntu, run: /etc/init.d/squid stop"
command: /etc/init.d/squid stop
when: is_ubuntu
when: is_ubuntu | bool
- name: Stop Squid
service:
@ -79,7 +79,7 @@
state: directory
- 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
- name: Add '{{ proxy }}' variable values to {{ iiab_ini_file }}

View file

@ -33,11 +33,12 @@
wan_cidr: "{{ CIDR.stdout }}"
when: wan_ip != "dhcp"
- name: Supply static WAN template
- name: Supply static WAN template (ubuntu-16)
template:
dest: /etc/systemd/network/IIAB-Static.network
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
include_tasks: down-debian.yml