2017-06-04 14:19:34 +00:00
- name : Set flag for fedora 18
2017-05-27 18:09:50 +00:00
set_fact :
is_F18 : True
when : ansible_distribution_release == "based on Fedora 18" or ansible_distribution_version == "18"
2017-07-04 20:07:47 +00:00
- name : abort if the OS is not supported
debug : msg="{{ ansible_local.local_facts.os }} Operating System is not supported"
2017-07-04 20:45:26 +00:00
failed_when : ansible_local.local_facts.os_ver == "OS_not_supported"
2017-07-04 20:07:47 +00:00
2017-05-27 18:09:50 +00:00
- name : get the uuidgen program
package : name=uuid-runtime
state=present
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2017-07-04 20:07:47 +00:00
- 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] }}
2017-05-27 18:09:50 +00:00
# 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
2017-06-04 14:19:34 +00:00
#TODO: Use regexp filter instead of hard-code ip
2017-05-27 18:09:50 +00:00
- name : Update chrony config file
template : backup=no
dest=/etc/chrony.conf
src=chrony.conf.j2
2017-06-26 22:24:26 +00:00
- name : Disable apparmor -- on by default in ubuntu
service : name=apparmor enabled=False state=stopped
when : is_ubuntu
2017-05-27 18:09:50 +00:00
- name : Disable selinux on next boot
selinux : state=disabled
register : selinux_disabled
when : ansible_selinux is defined and ansible_version >= '2' and ansible_selinux or ansible_selinux['status'] is defined and ansible_version < '2' and ansible_selinux['status'] != 'disabled'
- name : Disable selinux for this session (if needed)
command : setenforce Permissive
when : selinux_disabled is defined and selinux_disabled.changed
## DISCOVER PLATFORMS ######
2017-06-04 14:19:34 +00:00
- name : Discover if this is a rpi -- assume if so it is running raspbian
set_fact :
2017-05-27 18:09:50 +00:00
rpi_model : "rpi"
is_rpi : "True"
2017-07-04 22:39:45 +00:00
when : ansible_local.local_facts.os == "raspbian"
2017-05-27 18:09:50 +00:00
ignore_errors : true
- include : prep.yml
# we need to inialize the ini file
2017-06-09 23:25:56 +00:00
- include : iiab_ini.yml
2017-05-27 18:09:50 +00:00
- include : computed_vars.yml
- include : detected_network.yml
2017-06-04 14:19:34 +00:00
when : not installing
2017-05-27 18:09:50 +00:00
# Patch Fedora 21+ so usbmount works
# Set flag to True that was initialized to False in role defaults
# We can't undo this
- name : Does udev need patching
set_fact :
udev_needs_patch : True
when : ansible_distribution == "Fedora" and ansible_distribution_version >= "21"
# Same patch for CentOS 7.2
- name : Does udev need patching for Centos
set_fact :
udev_needs_patch : True
when : ansible_distribution == "CentOS" and ansible_distribution_version >= "7.2.1511"
- name : Copy udevd service to /etc/systemd/system to modify
copy : src=/usr/lib/systemd/system/systemd-udevd.service
dest=/etc/systemd/system/systemd-udevd.service
owner=root
group=root
mode=0644
when : udev_needs_patch
- name : Change MountFlags from slave to shared
lineinfile : backup=no
dest=/etc/systemd/system/systemd-udevd.service
regexp='^MountFlags'
line='MountFlags=shared'
state=present
when : udev_needs_patch
- name : Restart systemd-udevd.service
service : name=systemd-udevd
state=restarted
when : udev_needs_patch and not installing
# Put conditional actions for hardware platforms here
- include : raspberry_pi_2.yml
when : rpi_model != "none"
- name : Check if the identifier for intel's NUC6 builtin wifi is present
shell : "lsusb | grep 8087:0a2b | wc |gawk '{print $1}'"
register : usb_NUC6
ignore_errors : true
- name : download the firmware for built in wifi on NUC6
get_url : dest=/lib/firmware
2017-06-09 23:25:56 +00:00
url={{ iiab_download_url }}/iwlwifi-8000C-13.ucode
2017-05-27 18:09:50 +00:00
when : usb_NUC6.stdout|int > 0