From d40efd2fb7ffab99244fe2e394a5b651cb786aba Mon Sep 17 00:00:00 2001 From: mg Date: Tue, 22 Dec 2020 13:20:29 +0100 Subject: [PATCH] Rolle: install_packages: Variable extra_programs (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Syntax korrigiert - 2 Syntax korrigiert Fange leere Variable ab Abhängigkeit restic mit reingenommen Jenkins extra Programms als Var install_packages mit extra-programs Var ausgestattet Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com> Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/8 --- group_vars/all.yml | 30 +++++++++++++++++++ group_vars/jenkins.yml | 6 ++-- .../mgrote.install_packages/defaults/main.yml | 1 + roles/mgrote.install_packages/tasks/main.yml | 7 +++++ roles/mgrote.restic/tasks/main.yml | 1 + 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 5478180e..e67a913f 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -64,6 +64,36 @@ - .tmux.conf - .gitconfig - .vimrc + ### mgrote.install_packages + programs_common: + - locales + - build-essential + - ntp + - htop + - git + - dnsutils + - nano + - mc + - cifs-utils + - netdiscover + - tree + - curl + - logrotate + - ncdu + - net-tools + - apt-transport-https + - neofetch + - ntpdate + - acl + - vim + programs_only_physical: + - hddtemp + - ipmitool + - powertop + - s-tui + programs_only_vms: + - qemu-guest-agent + - open-vm-tools # Ansible Variablen ### User diff --git a/group_vars/jenkins.yml b/group_vars/jenkins.yml index cab1576a..9cd8989a 100644 --- a/group_vars/jenkins.yml +++ b/group_vars/jenkins.yml @@ -4,9 +4,6 @@ jenkins_http_port: 8080 jenkins_admin_username: "{{ lookup('keepass', 'jenkins_admin_name', 'password') }}" jenkins_admin_password: "{{ lookup('keepass', 'jenkins_admin_password', 'password') }}" -# jenkins_plugins: -# - name: ansible -# - name: docker jenkins_plugins_install_dependencies: true jenkins_plugins_state: latest jenkins_java_options: "-Djenkins.install.runSetupWizard=true" @@ -30,3 +27,6 @@ comment: 'jenkins' ### mgrote.restic restic_folders_to_backup: /usr/local /etc /root /home /var/lib/jenkins + ### mgrote.install_packages + programs_extra: + - sshpass diff --git a/roles/mgrote.install_packages/defaults/main.yml b/roles/mgrote.install_packages/defaults/main.yml index 96a2017f..dd6ade78 100644 --- a/roles/mgrote.install_packages/defaults/main.yml +++ b/roles/mgrote.install_packages/defaults/main.yml @@ -30,3 +30,4 @@ programs_only_vms: - qemu-guest-agent - open-vm-tools + programs_extra: diff --git a/roles/mgrote.install_packages/tasks/main.yml b/roles/mgrote.install_packages/tasks/main.yml index 8a989e46..6f65db5a 100644 --- a/roles/mgrote.install_packages/tasks/main.yml +++ b/roles/mgrote.install_packages/tasks/main.yml @@ -10,6 +10,13 @@ name: "{{ programs_common }}" state: present + - name: install extra-packages + become: yes + ansible.builtin.apt: + name: "{{ programs_extra }}" + state: present + when: programs_extra is defined + - name: install vm-packages become: yes ansible.builtin.apt: diff --git a/roles/mgrote.restic/tasks/main.yml b/roles/mgrote.restic/tasks/main.yml index 6dbf54cc..b10ac056 100644 --- a/roles/mgrote.restic/tasks/main.yml +++ b/roles/mgrote.restic/tasks/main.yml @@ -4,6 +4,7 @@ name: - restic - logrotate + - cifs-utils state: present - name: create /etc/restic