/usr/local/sbin/raspi-wifi-country.sh

This commit is contained in:
olli 2022-09-28 14:32:21 +02:00
parent a1360d5b4d
commit 83da8c3845

View File

@ -14,3 +14,32 @@
name: pi name: pi
state: absent state: absent
remove: yes remove: yes
- name: /usr/local/sbin/raspi-wifi-country.sh
blockinfile:
path: /usr/local/sbin/raspi-wifi-country.sh
create: yes
mode: 0500
owner: root
group: root
marker: "# {mark} ANSIBLE MANAGED BLOCK"
block: |
[ -e /var/log/raspi-wifi-country.log ] exit 0
raspi-config nonint do_wifi_country DE
echo "$(date) $$" >> /var/log/raspi-wifi-country.log
backup: yes
validate: /bin/bash -n %s
notify: run genpw.sh
- name: /usr/local/sbin/raspi-wifi-country.sh shebang
lineinfile:
path: /usr/local/sbin/raspi-wifi-country.sh
insertbefore: BOF
line: "#!/bin/bash -e"
- name: Gen initial passwords if not exists
ansible.builtin.shell: ./raspi-wifi-country.sh
args:
chdir: /usr/local/sbin
creates: /var/log/raspi-wifi-country.log