From aa164139cd4d4e099db9224f3e213c45a106d8d5 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Oct 2020 01:42:23 +0100 Subject: [PATCH 1/4] Expand funktionallity, improved vars and added keychain --- README.md | 6 ++++++ defaults/main.yml | 10 ++++++++++ tasks/keychain.yml | 22 ++++++++++++++++++++++ tasks/main.yml | 5 ++++- vars/main.yml | 2 +- 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tasks/keychain.yml diff --git a/README.md b/README.md index b4c0e29..141eacc 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,12 @@ base__package_state: 'present' # should we update all packages? base__upgrade_packages_to_latest_version: false +# install keychain (ssh agent) +base__install_keychain: true + +# install vim (comand line editor) +base__install_vim: true + # perform a simple versions check (true is recomended) submodules_versioncheck: false ``` diff --git a/defaults/main.yml b/defaults/main.yml index 37e73b3..971ab28 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,6 +20,16 @@ base__package_state: 'present' # should we update all packages? base__upgrade_packages_to_latest_version: "{{ upgrade_packages_to_latest_version }}" +# install keycain to have a awesome ssh agent +base__install_keychain: true + +# install vim as awesome command line editor +base__install_vim: "{{ editor_is_vim }}" + +# directlink to keychain becaus RHEL do not provide it... +_base__keychain_rpm: 'http://packages.psychotic.ninja/7/base/x86_64/RPMS//keychain-2.8.0-3.el7.psychotic.noarch.rpm' + + # LEGACY VARS # ++ WILL BE REMOVED SOON ++ # add eth zurich apt source diff --git a/tasks/keychain.yml b/tasks/keychain.yml new file mode 100644 index 0000000..7d09613 --- /dev/null +++ b/tasks/keychain.yml @@ -0,0 +1,22 @@ +--- +- name: install keychain to support ssh agent + become: yes + package: + name: keychain + state: latest + when: + - ansible_os_family != 'RedHat' + - install_keychain|bool + +- name: install keychain on centos + become: yes + yum: + name: + - "{{ _base__keychain_rpm }}" + - libselinux-python + state: present + when: + - ansible_os_family == 'RedHat' + - install_keychain|bool + + diff --git a/tasks/main.yml b/tasks/main.yml index 8c74c0a..e9b246f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,4 +22,7 @@ - base__upgrade_packages_to_latest_version|bool - include_tasks: editor.yml - when: editor_is_vim | bool + when: base__install_vim | bool + +- include_tasks: keychain.yml + when: base__install_keychain | bool diff --git a/vars/main.yml b/vars/main.yml index fc73e85..dc0045c 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -59,5 +59,5 @@ base__linux_packages: - asciinema - youtube-dl -playbook_version_number: 9004 # should be over ninethousand +playbook_version_number: 9005 # should be over ninethousand playbook_version_path: 'base-packages_roles-ansible_github.version' From 2f66304699df38f68e431e8054d177b38f25539e Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Oct 2020 01:45:23 +0100 Subject: [PATCH 2/4] package should not use latest --- tasks/keychain.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/keychain.yml b/tasks/keychain.yml index 7d09613..73cbc89 100644 --- a/tasks/keychain.yml +++ b/tasks/keychain.yml @@ -3,7 +3,7 @@ become: yes package: name: keychain - state: latest + state: "{{ base__package_state }}" when: - ansible_os_family != 'RedHat' - install_keychain|bool @@ -14,7 +14,7 @@ name: - "{{ _base__keychain_rpm }}" - libselinux-python - state: present + state: "{{ base__package_state }}" when: - ansible_os_family == 'RedHat' - install_keychain|bool From 3caa833d857d3ebe8fdc45a2337164d446480b92 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Oct 2020 02:35:23 +0100 Subject: [PATCH 3/4] fix typo --- tasks/keychain.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tasks/keychain.yml b/tasks/keychain.yml index 73cbc89..6fee0f1 100644 --- a/tasks/keychain.yml +++ b/tasks/keychain.yml @@ -6,7 +6,6 @@ state: "{{ base__package_state }}" when: - ansible_os_family != 'RedHat' - - install_keychain|bool - name: install keychain on centos become: yes @@ -17,6 +16,3 @@ state: "{{ base__package_state }}" when: - ansible_os_family == 'RedHat' - - install_keychain|bool - - From 60f6a6246eb86be780cb9b3427930eb1f738abde Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 11 Nov 2020 11:36:23 +0100 Subject: [PATCH 4/4] do not touch RHEL8 --- tasks/keychain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/keychain.yml b/tasks/keychain.yml index 6fee0f1..211d0b8 100644 --- a/tasks/keychain.yml +++ b/tasks/keychain.yml @@ -15,4 +15,4 @@ - libselinux-python state: "{{ base__package_state }}" when: - - ansible_os_family == 'RedHat' + - ansible_os_family == 'RedHat' and ansible_distribution_version | float <= 7