-fixup wifi items
-TPD: parameterize wifi setup, task dependencies
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
purge: true
|
purge: true
|
||||||
tags: wireless_ap
|
tags: wireless_ap
|
||||||
- name: configure wlan0
|
- name: configure wlan0
|
||||||
|
become: true
|
||||||
blockinfile:
|
blockinfile:
|
||||||
path: /etc/dhcpcd.conf
|
path: /etc/dhcpcd.conf
|
||||||
block: |
|
block: |
|
||||||
@@ -24,11 +25,22 @@
|
|||||||
become: true
|
become: true
|
||||||
template:
|
template:
|
||||||
src: "{{ role_path }}/templates/hostapd.conf.j2"
|
src: "{{ role_path }}/templates/hostapd.conf.j2"
|
||||||
dest: "/etc/hostapd/hostapd.conf
|
dest: "/etc/hostapd/hostapd.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
backup: yes
|
backup: yes
|
||||||
tags: wireless_ap
|
tags: wireless_ap
|
||||||
|
- name: configure hostapd startup
|
||||||
|
become: true
|
||||||
|
tags: wireless_ap
|
||||||
|
lineinfile:
|
||||||
|
state: present
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
regexp: "{{ item.regexp }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
with_items:
|
||||||
|
- { path: "/etc/init.d/hostapd", regexp: "^DAEMON_CONF=", line: "DAEMON_CONF=/etc/hostapd/hostapd.conf" }
|
||||||
|
- { path: "/etc/default/hostapd", regexp: "^#DAEMON_CONF=", line: "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"" }
|
||||||
- name: enable hostapd
|
- name: enable hostapd
|
||||||
become: true
|
become: true
|
||||||
systemd:
|
systemd:
|
||||||
@@ -61,13 +73,13 @@
|
|||||||
state: restarted
|
state: restarted
|
||||||
tags: wireless_ap
|
tags: wireless_ap
|
||||||
- name: enable ipv4.forwarding
|
- name: enable ipv4.forwarding
|
||||||
lineinfile:
|
|
||||||
path: "/etc/sysctl.conf"
|
|
||||||
state: present
|
|
||||||
regexp: '^#net\.ipv4\.ip_forward=1'
|
|
||||||
line: 'net.ipv4.ip_forward=1'
|
|
||||||
validate: 'sysctl -p'
|
|
||||||
become: true
|
become: true
|
||||||
|
sysctl:
|
||||||
|
name: net.ipv4.ip_forward
|
||||||
|
value: 1
|
||||||
|
sysctl_set: yes
|
||||||
|
state: present
|
||||||
|
reload: yes
|
||||||
tags: wireless_ap
|
tags: wireless_ap
|
||||||
- name: copy fw config
|
- name: copy fw config
|
||||||
become: true
|
become: true
|
||||||
|
|||||||
Reference in New Issue
Block a user