1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/2-common/tasks/xo.yml

152 lines
3.7 KiB
YAML
Raw Normal View History

2017-05-27 18:09:50 +00:00
- name: XO Server specific tasks
command: echo Starting XO.yml
- name: Disable sleep
command: touch /etc/powerd/flags/inhibit-suspend
2017-12-08 06:05:03 +00:00
args:
creates: /etc/powerd/flags/inhibit-suspend
2017-05-27 18:09:50 +00:00
- name: Disable sleep on lid closing
2017-12-08 06:05:03 +00:00
lineinfile:
dest: /etc/powerd/powerd.conf
regexp: '^config_SLEEP_WHEN_LID_CLOSED'
line: 'config_SLEEP_WHEN_LID_CLOSED="no"'
state: present
backup: yes
2017-05-27 18:09:50 +00:00
- name: Keep yum cache
2017-12-08 06:05:03 +00:00
ini_file:
dest: /etc/yum.conf
section: main
option: keepcache
value: 1
2017-05-27 18:09:50 +00:00
when: not installing
- name: Keep docs when installing packages
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/rpm/macros.imgcreate
regexp: '^%_excludedocs'
state: absent
2017-05-27 18:09:50 +00:00
2017-10-31 03:30:29 +00:00
- name: Pre-install packages
2017-12-08 06:05:03 +00:00
package:
name: "{{ item }}"
state: latest
2017-05-27 18:09:50 +00:00
with_items:
2017-12-08 06:22:54 +00:00
- usbmount
- man
- man-db
- man-pages
2017-05-27 18:09:50 +00:00
2017-10-31 03:30:29 +00:00
- name: Re-install packages
2017-05-27 18:09:50 +00:00
shell: yum -y reinstall sed libidn grep which util-linux wget gnupg2 groff gnash yum
when: not osbuilder is defined
- name: Configure networkmanager plugin
2017-12-08 06:05:03 +00:00
ini_file:
dest: /etc/NetworkManager/NetworkManager.conf
section: main
option: plugins
value: ifcfg-rh,keyfile
2017-05-27 18:09:50 +00:00
2017-10-31 03:30:29 +00:00
- name: Check for modem config file
2017-12-08 06:05:03 +00:00
stat:
path: /etc/NetworkManager/system-connections/"Sugar Modem Connection"
2017-05-27 18:09:50 +00:00
register: config
- name: Change failure and interval settings for modem connection
2017-12-08 06:05:03 +00:00
ini_file:
dest: /etc/NetworkManager/system-connections/"Sugar Modem Connection"
section: ppp
option: "{{ item.option }}"
value: "{{ item.value }}" # "{{ item.value | string }}" not nec, as they're already strings.
2017-12-08 06:05:03 +00:00
backup: yes
mode: '0600'
2017-05-27 18:09:50 +00:00
with_items:
2017-12-08 06:05:03 +00:00
- { option: 'lcp-echo-failure', value: '5' }
- { option: 'lcp-echo-interval', value: '30' }
2017-05-27 18:09:50 +00:00
when: config.stat.exists
- name: Create bigger rwtab
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/sysconfig/readonly-root
regexp: '^RW_OPTIONS'
line: 'RW_OPTIONS="-o size=4M -o nr_inodes=2048"'
state: present
2017-05-27 18:09:50 +00:00
- name: Remove dhcpd entry from /etc/rwtab
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/rwtab
regexp: '^empty.*/var/lib/dhcpd'
state: absent
2017-05-27 18:09:50 +00:00
- name: Remove php entry from /etc/rwtab
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/rwtab
regexp: '^empty.*/var/lib/php'
state: absent
2017-05-27 18:09:50 +00:00
- name: Persist /etc/hosts between reboots
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/statetab.d/olpc
regexp: '^/etc/hosts'
state: absent
2017-05-27 18:09:50 +00:00
- name: Disable /var/log tmpfs
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/fstab
regexp: '^varlog.*'
state: absent
2017-05-27 18:09:50 +00:00
- name: Enlarge the /tmp directory so that url_get does not error out
2017-12-08 06:05:03 +00:00
lineinfile:
backup: yes
dest: /etc/fstab
regexp: '^/tmp*'
line: '/tmp /tmp tmpfs rw,size=600m 0 0'
2017-05-27 18:09:50 +00:00
- name: Disable graphical login
2017-12-08 06:05:03 +00:00
file:
src: /lib/systemd/system/multi-user.target
dest: /etc/systemd/system/default.target
state: link
2017-05-27 18:09:50 +00:00
register: disabled_login
- name: Remove custom profile settings
2017-12-08 06:05:03 +00:00
file:
path: /etc/profile.d/zzz_olpc.sh
state: absent
2017-05-27 18:09:50 +00:00
- name: Download substitute software for i386 on FC18 XO1.5
2017-12-08 06:05:03 +00:00
get_url:
url: "{{ iiab_download_url }}/{{ item }}"
dest: "{{ downloads_dir }}/{{ item }}"
timeout: "{{ download_timeout }}"
2017-05-27 18:09:50 +00:00
with_items:
2017-12-08 06:22:54 +00:00
- hostapd_8188_i386
when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and internet_available
2017-05-27 18:09:50 +00:00
- name: Put the substitute in place
2017-12-08 06:05:03 +00:00
copy:
src: "{{ downloads_dir }}/hostapd_8188_i386"
dest: /usr/sbin/hostapd
backup: yes
# owner: root
# group: root
mode: '0775'
2017-12-08 06:05:03 +00:00
when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5"
2017-05-27 18:09:50 +00:00
- name: Reboot system
command: /sbin/reboot
when: disabled_login.changed and not installing
ignore_errors: yes
async: 300
poll: 120