From 18a001b86e1e3172d2d29c1869a09d12f47c72ba Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Wed, 6 Apr 2022 12:07:28 +0200 Subject: [PATCH] added playbook personal-linux-config --- personal-linux-config.yml | 7 +++++++ tasks/debian-general/git.yml | 7 +++++++ tasks/general/personal-linux-config.yml | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 personal-linux-config.yml create mode 100644 tasks/debian-general/git.yml create mode 100644 tasks/general/personal-linux-config.yml diff --git a/personal-linux-config.yml b/personal-linux-config.yml new file mode 100644 index 0000000..9b720ed --- /dev/null +++ b/personal-linux-config.yml @@ -0,0 +1,7 @@ +--- +- hosts: all + become: true + tasks: + - import_tasks: tasks/debian-general/git.yml + when: ansible_facts["os_family"] == "Debian" + - import_tasks: tasks/general/personal-linux-config.yml \ No newline at end of file diff --git a/tasks/debian-general/git.yml b/tasks/debian-general/git.yml new file mode 100644 index 0000000..e6a1f97 --- /dev/null +++ b/tasks/debian-general/git.yml @@ -0,0 +1,7 @@ +--- +- name: Ensure git is installed and updated + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 0 + name: git + state: latest diff --git a/tasks/general/personal-linux-config.yml b/tasks/general/personal-linux-config.yml new file mode 100644 index 0000000..3cf11f5 --- /dev/null +++ b/tasks/general/personal-linux-config.yml @@ -0,0 +1,16 @@ +--- +- name: Ensure the hostname package is installed and updated + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 0 + name: hostname + state: latest +- name: Ensure the personal-linux-config repositories is updated + ansible.builtin.git: + dest: /root/personal-linux-config + repo: https://git.bjphoster.com/b.pedini/personal-linux-config + clone: yes + update: yes +- name: Ensure the config changes are deployed + ansible.builtin.shell: + cmd: sh -c "cd /root/personal-linux-config; bash /root/personal-linux-config/deploy.sh --server"