1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/1-prep/tasks/main.yml

84 lines
2.3 KiB
YAML

- name: get the uuidgen program
package: name=uuid-runtime
state=present
when: is_debuntu
- name: Test for UUID file
stat: path=/etc/iiab/uuid
register: uuid_file
- name: Create folder to hold uuid
file: path=/etc/iiab state=directory
when: not uuid_file.stat.exists
- name: If no uuid exists, create one
shell: uuidgen
register: uuid_response
when: not uuid_file.stat.exists
- name: Put the uuid in place
shell: echo {{ uuid_response.stdout_lines[0] }} > /etc/iiab/uuid
when: not uuid_file.stat.exists
- name: get the uuid
command: cat /etc/iiab/uuid
register: stored_uuid
- name: get the value into a variable
set_fact:
uuid={{ stored_uuid.stdout_lines[0] }}
# for rpi, without rtc, we need time as soon as possible
- name: Install chrony package
package: name={{ item }}
state=present
with_items:
- chrony
tags:
- download
#TODO: Use regexp filter instead of hard-code ip
- name: Update chrony config file
template: backup=no
dest=/etc/chrony.conf
src=chrony.conf.j2
- name: Disable apparmor -- on by default in ubuntu
service: name=apparmor enabled=False state=stopped
when: first_run and is_ubuntu
ignore_errors: true
- name: Disable selinux on next boot
selinux: state=disabled
register: selinux_disabled
when: first_run and not is_debuntu
- name: Disable selinux for this session (if needed)
command: setenforce Permissive
when: not is_debuntu and selinux_disabled is defined and selinux_disabled.changed
## DISCOVER PLATFORMS ######
- name: Discover if this is a rpi -- assume if so it is running raspbian
set_fact:
rpi_model: "rpi"
is_rpi: "True"
when: ansible_local.local_facts.os == "raspbian"
ignore_errors: true
- include: prep.yml
when: first_run
# Put conditional actions for hardware platforms here
- include: raspberry_pi_2.yml
when: first_run and rpi_model != "none"
- name: Check if the identifier for intel's NUC6 builtin wifi is present
shell: "lsusb | grep 8087:0a2b | wc |awk '{print $1}'"
register: usb_NUC6
ignore_errors: true
when: first_run
- name: download the firmware for built in wifi on NUC6
get_url: dest=/lib/firmware
url={{ iiab_download_url }}/iwlwifi-8000C-13.ucode
when: first_run and usb_NUC6.stdout|int > 0