debian.ansible.raspberry/raspberry.yml

46 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2022-07-19 12:17:04 +02:00
---
- name: Raspberry Debian Linux Setup
2022-07-19 17:11:30 +02:00
hosts: all
2022-07-19 12:17:04 +02:00
tasks:
- name: Remove the grpup pi
ansible.builtin.user:
name: pi
state: absent
remove: yes
- name: Remove the user pi
ansible.builtin.user:
name: pi
state: absent
remove: yes
2022-09-28 14:32:21 +02:00
- 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: |
2022-09-28 14:51:35 +02:00
[ -e /var/log/raspi-wifi-country.log ] && exit 0
2022-09-28 14:32:21 +02:00
raspi-config nonint do_wifi_country DE
echo "$(date) $$" >> /var/log/raspi-wifi-country.log
backup: yes
validate: /bin/bash -n %s
- name: /usr/local/sbin/raspi-wifi-country.sh shebang
lineinfile:
path: /usr/local/sbin/raspi-wifi-country.sh
insertbefore: BOF
line: "#!/bin/bash -e"
2022-09-28 14:41:54 +02:00
- name: run /usr/local/sbin/raspi-wifi-country.sh
2022-09-28 14:32:21 +02:00
ansible.builtin.shell: ./raspi-wifi-country.sh
args:
chdir: /usr/local/sbin
creates: /var/log/raspi-wifi-country.log
2022-11-10 12:22:49 +01:00