mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #1280 from holta/ansible-output
1-prep Ansible output more readable & precise
This commit is contained in:
commit
ffbc818552
2 changed files with 21 additions and 23 deletions
|
@ -3,18 +3,18 @@
|
||||||
- name: ...IS BEGINNING ============================================
|
- name: ...IS BEGINNING ============================================
|
||||||
command: echo
|
command: echo
|
||||||
|
|
||||||
- name: Install uuidgen program (debuntu)
|
- name: Install uuid-runtime package (debuntu)
|
||||||
package:
|
package:
|
||||||
name: uuid-runtime
|
name: uuid-runtime
|
||||||
state: present
|
state: present
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Test for /etc/iiab/uuid file
|
- name: Does /etc/iiab/uuid file exist?
|
||||||
stat:
|
stat:
|
||||||
path: /etc/iiab/uuid
|
path: /etc/iiab/uuid
|
||||||
register: uuid_file
|
register: uuid_file
|
||||||
|
|
||||||
- name: Create folder to hold uuid
|
- name: If not, create folder /etc/iiab
|
||||||
file:
|
file:
|
||||||
path: /etc/iiab
|
path: /etc/iiab
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -25,15 +25,15 @@
|
||||||
register: uuid_response
|
register: uuid_response
|
||||||
when: not uuid_file.stat.exists
|
when: not uuid_file.stat.exists
|
||||||
|
|
||||||
- name: Put the uuid in place
|
- name: Put uuid in place at /etc/iiab/uuid
|
||||||
shell: echo {{ uuid_response.stdout_lines[0] }} > /etc/iiab/uuid
|
shell: echo {{ uuid_response.stdout_lines[0] }} > /etc/iiab/uuid
|
||||||
when: not uuid_file.stat.exists
|
when: not uuid_file.stat.exists
|
||||||
|
|
||||||
- name: Get the uuid
|
- name: Grab the uuid from /etc/iiab/uuid, into register stored_uuid
|
||||||
command: cat /etc/iiab/uuid
|
command: cat /etc/iiab/uuid
|
||||||
register: stored_uuid
|
register: stored_uuid
|
||||||
|
|
||||||
- name: Get the value into a variable
|
- name: Place the uuid from register into variable/fact "uuid"
|
||||||
set_fact:
|
set_fact:
|
||||||
uuid: "{{ stored_uuid.stdout_lines[0] }}"
|
uuid: "{{ stored_uuid.stdout_lines[0] }}"
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
tags: openvpn
|
tags: openvpn
|
||||||
|
|
||||||
# for rpi, without rtc, we need time as soon as possible
|
# for rpi, without rtc, we need time as soon as possible
|
||||||
- name: Install chrony package
|
- name: Install chrony (an NTP package) especially for RPi's lacking RTC
|
||||||
package:
|
package:
|
||||||
name: chrony
|
name: chrony
|
||||||
state: present
|
state: present
|
||||||
|
@ -64,11 +64,11 @@
|
||||||
- download
|
- download
|
||||||
|
|
||||||
#TODO: Use regexp filter instead of hard-code ip
|
#TODO: Use regexp filter instead of hard-code ip
|
||||||
- name: Update chrony config file
|
- name: Install /etc/chrony.conf from template
|
||||||
template:
|
template:
|
||||||
backup: no
|
|
||||||
dest: /etc/chrony.conf
|
|
||||||
src: chrony.conf.j2
|
src: chrony.conf.j2
|
||||||
|
dest: /etc/chrony.conf
|
||||||
|
backup: no
|
||||||
|
|
||||||
- name: Disable AppArmor -- override OS default (ubuntu)
|
- name: Disable AppArmor -- override OS default (ubuntu)
|
||||||
service:
|
service:
|
||||||
|
@ -93,12 +93,12 @@
|
||||||
- include_tasks: raspberry_pi.yml
|
- include_tasks: raspberry_pi.yml
|
||||||
when: first_run and rpi_model != "none"
|
when: first_run and rpi_model != "none"
|
||||||
|
|
||||||
- name: Check if the identifier for Intel's NUC6 builtin WiFi is present
|
- name: Check if the identifier for Intel's NUC6 built-in WiFi is present
|
||||||
shell: "lsusb | grep 8087:0a2b | wc | awk '{print $1}'"
|
shell: "lsusb | grep 8087:0a2b | wc | awk '{print $1}'"
|
||||||
register: usb_NUC6
|
register: usb_NUC6
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Download the firmware for built-in WiFi on NUC6
|
- name: Download {{ iiab_download_url }}/iwlwifi-8000C-13.ucode to /lib/firmware for built-in WiFi on NUC6 # iiab_download_url is http://download.iiab.io/packages
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ iiab_download_url }}/iwlwifi-8000C-13.ucode"
|
url: "{{ iiab_download_url }}/iwlwifi-8000C-13.ucode"
|
||||||
dest: /lib/firmware
|
dest: /lib/firmware
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Setup specific to the Raspberry Pi
|
# Setup specific to the Raspberry Pi
|
||||||
|
|
||||||
- name: Add a udev rule to transfer hwclock to system clock at dev creation
|
- name: Install udev rule /etc/udev/rules.d/92-rtc-i2c.rules from template, to transfer hwclock to system clock at dev creation, if rtc_id is defined and rtc_id != "none"
|
||||||
template:
|
template:
|
||||||
src: 92-rtc-i2c.rules
|
src: 92-rtc-i2c.rules
|
||||||
dest: /etc/udev/rules.d/92-rtc-i2c.rules
|
dest: /etc/udev/rules.d/92-rtc-i2c.rules
|
||||||
|
@ -10,15 +10,15 @@
|
||||||
when: rtc_id is defined and rtc_id != "none"
|
when: rtc_id is defined and rtc_id != "none"
|
||||||
|
|
||||||
# RTC requires a change to the device tree (and reboot)
|
# RTC requires a change to the device tree (and reboot)
|
||||||
- name: Check for needing to enable i2c rtc device in config.txt
|
- name: Check for need to enable i2c-rtc device in /boot/config.txt (requires reboot!)
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /boot/config.txt
|
dest: /boot/config.txt
|
||||||
line: "dtoverlay=i2c-rtc,{{ rtc_id }}=on"
|
line: "dtoverlay=i2c-rtc,{{ rtc_id }}=on"
|
||||||
state: present
|
state: present
|
||||||
register: rpiconfig
|
register: rpiconfig # HMMM REGISTER "rpiconfig" IS *COMPLETELY UNUSED* AS OF 2018-11-02
|
||||||
when: rtc_id != "none"
|
when: rtc_id != "none"
|
||||||
|
|
||||||
- name: Add a udev rule to transfer hwclock to system clock at dev creation
|
- name: Install udev rule /etc/udev/rules.d/92-rtc-i2c.rules from template, to transfer hwclock to system clock at dev creation, if rtc_id != "none"
|
||||||
template:
|
template:
|
||||||
src: 92-rtc-i2c.rules
|
src: 92-rtc-i2c.rules
|
||||||
dest: /etc/udev/rules.d/92-rtc-i2c.rules
|
dest: /etc/udev/rules.d/92-rtc-i2c.rules
|
||||||
|
@ -27,25 +27,23 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: rtc_id != "none"
|
when: rtc_id != "none"
|
||||||
|
|
||||||
- name: Pre-install packages
|
- name: Install latest ntp package
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: ntp
|
||||||
state: latest
|
state: latest
|
||||||
with_items:
|
|
||||||
- ntp
|
|
||||||
|
|
||||||
- name: Increase the swap file size, as kalite pip download fails (debuntu)
|
- name: Increase swap file size (to CONF_SWAPSIZE=500 in /etc/dphys-swapfile) as kalite pip download fails (debuntu)
|
||||||
lineinfile:
|
lineinfile:
|
||||||
regexp: "^CONF_SWAPSIZE"
|
regexp: "^CONF_SWAPSIZE"
|
||||||
line: CONF_SWAPSIZE=500
|
line: CONF_SWAPSIZE=500
|
||||||
dest: /etc/dphys-swapfile
|
path: /etc/dphys-swapfile
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Restart the swap service (debuntu)
|
- name: Restart the swap service (debuntu)
|
||||||
command: /etc/init.d/dphys-swapfile restart
|
command: /etc/init.d/dphys-swapfile restart
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Add RPi rootfs resizing service
|
- name: Add RPi rootfs resizing systemd service
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue