From 34d48bf203475690c58e3479c8a32a867e917fe1 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sun, 13 Mar 2016 17:21:56 +0200 Subject: [PATCH] - Playbook. --- .gitignore | 12 +++++++++++ README | 14 ------------- README.rst | 4 ++++ playbook.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 .gitignore delete mode 100644 README create mode 100644 README.rst create mode 100644 playbook.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8ccc7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.swp +*.swo +~* +*~ +.DS_Store +__pycache__ +*.pyc +.cache/ +.molecule/ +.vagrant/ +*.log +*.retry diff --git a/README b/README deleted file mode 100644 index 793ebc5..0000000 --- a/README +++ /dev/null @@ -1,14 +0,0 @@ -ansible-desktop -############### - -Ansible playbook for setting up new desktops. - -TODO ----- - -- Allow avahi in home and work firewalld zones. -- Allow ssh in home firewalld zone. -- Set /etc/default/grub. -- Systemd journal. -- Systemd timesyncd. -- Internal NATed network for nspawn using networkd. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..3fe691d --- /dev/null +++ b/README.rst @@ -0,0 +1,4 @@ +ansible-role-desktop +#################### + +Ansible playbook for setting up new desktops. For personal use. diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..40658e4 --- /dev/null +++ b/playbook.yml @@ -0,0 +1,56 @@ +--- + +- hosts: all + tasks: + - name: apt install + with_items: + - plymouth + - network-manager + - initramfs-tools + apt: + name: '{{ item }}' + state: present + update_cache: yes + cache_valid_time: 3600 + + - name: Set NetworkManager to ignore some interfaces + ini_file: + dest: /etc/NetworkManager/NetworkManager.conf + section: keyfile + option: unmanaged-devices + value: interface-name:docker0;interface-name:vboxnet0;interface-name:nspawnbr0 + state: present + + - name: Configure Plymouth + ini_file: + dest: /etc/plymouth/plymouthd.conf + section: Daemon + option: Theme + value: spinner + register: configure_plymouth + + - name: Update initramfs + when: configure_plymouth.changed + command: /usr/sbin/update-initramfs -u + + - name: Configure GRUB + with_dict: + GRUB_TIMEOUT: 1 + GRUB_CMDLINE_LINUX_DEFAULT: 'quiet cgroup_enable=memory splash allow-discards root_trim=yes swapaccount=1' + lineinfile: + dest: /etc/default/grub + line: '{{ item.key }}="{{ item.value }}"' + regexp: '^{{ item.key }}=' + state: present + register: configure_grub + + - name: Update GRUB + when: configure_grub.changed + command: /usr/sbin/update-grub + + - name: Make /tmp tmpfs mount + mount: + fstype: tmpfs + name: /tmp + src: none + state: present -- GitLab