1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

2 vars in detected_network.yml to netplan.yml; FULL/PATHS for 1-prep

This commit is contained in:
root 2022-07-22 10:53:24 -04:00
parent 7d0bf6c1ef
commit 556db4bfb6
5 changed files with 43 additions and 31 deletions

View file

@ -36,25 +36,22 @@
device_gw: "{{ discovered_wan_iface }}" device_gw: "{{ discovered_wan_iface }}"
when: ansible_default_ipv4.gateway is defined when: ansible_default_ipv4.gateway is defined
- name: Figure out netplan file name # 2022-07-22: Moved to netplan.yml
shell: ls /etc/netplan # - name: Figure out netplan file name
register: netplan # shell: ls /etc/netplan
ignore_errors: True # pre 17.10 doesn't use netplan # register: netplan
when: is_ubuntu # ignore_errors: True # pre 17.10 doesn't use netplan
# when: is_ubuntu
- name: Setting dhcpcd_test results - name: Setting dhcpcd_test results
set_fact: set_fact:
dhcpcd_result: "{{ ansible_local.local_facts.dhcpcd }}" dhcpcd_result: "{{ ansible_local.local_facts.dhcpcd }}"
- name: Setting systemd_networkd results # 2022-07-22: Copied to netplan.yml (REMOVE DUPLICATE CODE LATER?!)
- name: "Set 'systemd_networkd_active: True' if local_facts.systemd_networkd confirms"
set_fact: set_fact:
systemd_networkd_active: True systemd_networkd_active: True
when: 'ansible_local.local_facts.systemd_networkd == "enabled"' when: ansible_local.local_facts.systemd_networkd == "enabled" or ansible_local.local_facts.systemd_networkd == "enabled-runtime"
- name: Setting systemd_networkd-2 results
set_fact:
systemd_networkd_active: True
when: 'ansible_local.local_facts.systemd_networkd == "enabled-runtime"'
- name: Setting network_manager results - name: Setting network_manager results
set_fact: set_fact:

View file

@ -96,8 +96,8 @@
dest: /usr/bin/ dest: /usr/bin/
mode: 0755 mode: 0755
with_items: with_items:
- gateway/iiab-internet-on - roles/network/templates/gateway/iiab-internet-on # Invoked by 1-prep (so full path needed)
- gateway/iiab-internet-off - roles/network/templates/gateway/iiab-internet-off # Invoked by 1-prep (so full path needed)
- name: 'Install /usr/local/sbin/netwarn for pop-ups on boot, if iiab-network should be run' - name: 'Install /usr/local/sbin/netwarn for pop-ups on boot, if iiab-network should be run'
include_tasks: roles/network/tasks/netwarn.yml # Invoked by 1-prep (so full path needed) include_tasks: roles/network/tasks/netwarn.yml # Invoked by 1-prep (so full path needed)

View file

@ -25,21 +25,23 @@
include_tasks: install.yml include_tasks: install.yml
when: network_install and network_installed is undefined when: network_install and network_installed is undefined
- name: Create /usr/bin/iiab-hotspot-on from template # 2022-07-22: Should be done in install.yml above (avoid duplication if poss?)
template: #
src: hostapd/iiab-hotspot-on # - name: Create /usr/bin/iiab-hotspot-on from template
dest: /usr/bin/iiab-hotspot-on # template:
owner: root # src: hostapd/iiab-hotspot-on
group: root # dest: /usr/bin/iiab-hotspot-on
mode: 0755 # owner: root
# group: root
- name: Create /usr/bin/iiab-hotspot-off from template # mode: 0755
template: #
src: hostapd/iiab-hotspot-off # - name: Create /usr/bin/iiab-hotspot-off from template
dest: /usr/bin/iiab-hotspot-off # template:
owner: root # src: hostapd/iiab-hotspot-off
group: root # dest: /usr/bin/iiab-hotspot-off
mode: 0755 # owner: root
# group: root
# mode: 0755
- name: Configuring Network if enabled - name: Configuring Network if enabled
block: block:

View file

@ -1,3 +1,16 @@
# 2022-07-22: Moved from detected_network.yml
- name: Figure out netplan file name
shell: ls /etc/netplan
register: netplan
#ignore_errors: True # pre 17.10 doesn't use netplan
# 2022-07-22: Copied from detected_network.yml (REMOVE DUPLICATE CODE LATER?!)
- name: "Set 'systemd_networkd_active: True' if local_facts.systemd_networkd confirms"
set_fact:
systemd_networkd_active: True
when: ansible_local.local_facts.systemd_networkd == "enabled" or ansible_local.local_facts.systemd_networkd == "enabled-runtime"
- name: Disable cloud-init the easy way - name: Disable cloud-init the easy way
shell: touch /etc/cloud/cloud-init.disabled shell: touch /etc/cloud/cloud-init.disabled
when: item|trim == "50-cloud-init.yaml" when: item|trim == "50-cloud-init.yaml"

View file

@ -22,7 +22,7 @@
- name: 'Install from template: /usr/share/mate/autostart/netwarn-iiab-network.desktop' - name: 'Install from template: /usr/share/mate/autostart/netwarn-iiab-network.desktop'
template: template:
src: netwarn/netwarn-iiab-network.desktop src: roles/network/templates/netwarn/netwarn-iiab-network.desktop # Invoked by 1-prep (so full path needed)
dest: /usr/share/mate/autostart/ dest: /usr/share/mate/autostart/
when: mate_dir.stat.exists and mate_dir.stat.isdir when: mate_dir.stat.exists and mate_dir.stat.isdir
@ -34,7 +34,7 @@
- name: 'If a supported graphical OS is detected, install from template: /usr/local/sbin/netwarn' - name: 'If a supported graphical OS is detected, install from template: /usr/local/sbin/netwarn'
template: template:
src: netwarn/netwarn src: roles/network/templates/netwarn/netwarn # Invoked by 1-prep (so full path needed)
dest: /usr/local/sbin/ dest: /usr/local/sbin/
mode: 0755 mode: 0755
when: lxde_pi_autostart_present or (mate_dir.stat.exists and mate_dir.stat.isdir) when: lxde_pi_autostart_present or (mate_dir.stat.exists and mate_dir.stat.isdir)