From aa164139cd4d4e099db9224f3e213c45a106d8d5 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Oct 2020 01:42:23 +0100 Subject: [PATCH] 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'