Commit d81c77d4 authored by Daniel Müller's avatar Daniel Müller
Browse files

Stabilize playbook

Changed the playbook to no longer perform unnecessary tasks.
This allows for consecutive reruns without changes.
This also allows for stable vm updates via ansible.
parent 36fb72b5
---
- hosts: localhost
tasks:
pre_tasks:
- name: Update packages
become: true
......@@ -9,6 +9,8 @@
update_cache: true
force_apt_get: true
tasks:
- name: Install xfce desktop and associated programms
become: true
apt:
......@@ -82,6 +84,17 @@
pip:
executable: pip3
name: sshuttle
- name: Get current mpstools hash
set_fact:
mpstools_curr_hash: "{{ lookup('file', '/opt/mpstools/checksum', errors='ignore') }}"
- name: Get new mpstools hash
stat:
path: files/mpstools.tgz
checksum_algorithm: sha1
get_checksum: true
register: mpstools_new
- name: Install toolchain
become: true
......@@ -91,14 +104,7 @@
src: files/mpstools.tgz
dest: /opt
keep_newer: true
- name: Add toolchain to PATH (for bash only)
become: true
become_user: fs
lineinfile:
path: ~/.bashrc
line: 'export PATH="/opt/mpstools/bin:$PATH"'
create: true
when: mpstools_curr_hash != mpstools_new.stat.checksum
# This has worked while testing but it is not a good way to solve the issue.
# It basically forces the executables to use the newer version of libncurses
......@@ -111,6 +117,24 @@
- /opt/mpstools/bin/arm-v4t-eabi-gdb
- /opt/mpstools/bin/arm-elf-insight
- /opt/mpstools/bin/arm-elf-eabi-insight
when: mpstools_curr_hash != mpstools_new.stat.checksum
- name: Set toolchain checksum
become: true
copy:
owner: root
group: root
dest: /opt/mpstools/checksum
content: "{{ mpstools_new.stat.checksum }}"
when: mpstools_curr_hash != mpstools_new.stat.checksum
- name: Add toolchain to PATH (for bash only)
become: true
become_user: fs
lineinfile:
path: ~/.bashrc
line: 'export PATH="/opt/mpstools/bin:$PATH"'
create: true
- name: Install xfce themes
become: true
......@@ -170,7 +194,6 @@
src: files/conf/lightdm-gtk-greeter.conf
dest: /etc/lightdm
# TODO: GEDIT THEME IS NOT APPLIED
- name: Install preconfigured config
become: true
copy:
......@@ -178,14 +201,21 @@
group: fs
src: files/conf/home-conf/{{ item }}
dest: /home/fs
force: false
with_items:
- .config
- .sn
- name: Create user home dirs
- name: Check if user dirs exist
stat:
path: /home/fs/.config/user-dirs.dirs
register: user_dirs
- name: Create user dirs
become: true
become_user: fs
shell: xdg-user-dirs-update
when: not user_dirs.stat.exists
# This is a critical step to check for security issues. The installed ca
# comes from the DFN website: https://pki.pca.dfn.de/dfn-ca-global-g2/cgi-bin/pub/pki
......@@ -262,6 +292,7 @@
become_user: fs
shell: xdg-user-dir DESKTOP
register: user_desktop
changed_when: false
- name: Install desktop launchers
become: true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment