From f6197356290a9eb42bb4121d8a5916ae030eddde Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Fri, 15 Jul 2022 17:25:33 +0200 Subject: [PATCH 1/5] Add Dell OpenManage APT repo --- roles/ubuntu_base/tasks/custom-apt-repos.yml | 11 +++++++++++ roles/ubuntu_base/tasks/main.yml | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 roles/ubuntu_base/tasks/custom-apt-repos.yml diff --git a/roles/ubuntu_base/tasks/custom-apt-repos.yml b/roles/ubuntu_base/tasks/custom-apt-repos.yml new file mode 100644 index 0000000..e6e094e --- /dev/null +++ b/roles/ubuntu_base/tasks/custom-apt-repos.yml @@ -0,0 +1,11 @@ +--- +- name: "configure dell apt repo" + apt_repository: + repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main" + state: "present" + tags: setup-custom-apt + +- name: update apt cache + apt: + update_cache: yes + tags: setup-custom-apt \ No newline at end of file diff --git a/roles/ubuntu_base/tasks/main.yml b/roles/ubuntu_base/tasks/main.yml index 1db59dd..af771a8 100644 --- a/roles/ubuntu_base/tasks/main.yml +++ b/roles/ubuntu_base/tasks/main.yml @@ -1,4 +1,6 @@ --- +- import_tasks: custom-apt-repos.yml - import_tasks: upgrade.yml - import_tasks: base.yml - import_tasks: users.yml + -- 2.43.4 From cbe059f24000914366bf9670308a3ff846c10e2b Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Fri, 15 Jul 2022 17:29:03 +0200 Subject: [PATCH 2/5] Install Dell OpenManage --- roles/ubuntu_base/tasks/base.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/ubuntu_base/tasks/base.yml b/roles/ubuntu_base/tasks/base.yml index a51c443..6202009 100644 --- a/roles/ubuntu_base/tasks/base.yml +++ b/roles/ubuntu_base/tasks/base.yml @@ -9,6 +9,8 @@ - apparmor - haveged - mosh + - srvadmin-all # Dell OpenManage + tags: install-base-packages - name: Install necessary packages via pip pip: -- 2.43.4 From 065b76de4795ec8b2a10f54dcad9f148e8a482e4 Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Fri, 15 Jul 2022 17:34:27 +0200 Subject: [PATCH 3/5] Add some more useful ansible tags - do-full-system-upgrade - setup-users - install-base-packages --- roles/ubuntu_base/tasks/base.yml | 1 + roles/ubuntu_base/tasks/upgrade.yml | 1 + roles/ubuntu_base/tasks/users.yml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/roles/ubuntu_base/tasks/base.yml b/roles/ubuntu_base/tasks/base.yml index 6202009..7d65ccb 100644 --- a/roles/ubuntu_base/tasks/base.yml +++ b/roles/ubuntu_base/tasks/base.yml @@ -19,3 +19,4 @@ packages: - docker - docker-compose + tags: install-base-packages diff --git a/roles/ubuntu_base/tasks/upgrade.yml b/roles/ubuntu_base/tasks/upgrade.yml index c4cd33b..73d6ec5 100644 --- a/roles/ubuntu_base/tasks/upgrade.yml +++ b/roles/ubuntu_base/tasks/upgrade.yml @@ -3,3 +3,4 @@ apt: update_cache: yes upgrade: full + tags: "do-full-system-upgrade" diff --git a/roles/ubuntu_base/tasks/users.yml b/roles/ubuntu_base/tasks/users.yml index 4e9954c..2ce0a9d 100644 --- a/roles/ubuntu_base/tasks/users.yml +++ b/roles/ubuntu_base/tasks/users.yml @@ -7,6 +7,7 @@ update_password: "on_create" groups: "{{ item.groups }}" loop: "{{ users | default([]) }}" + tags: "setup-users" - name: "Add ssh authorized_keys" authorized_key: @@ -15,6 +16,7 @@ with_subelements: - "{{ users | default([]) }}" - keys + tags: "setup-users" - name: "Add ssh authorized_keys to root user" authorized_key: @@ -23,3 +25,4 @@ with_subelements: - "{{ users | default([]) }}" - keys + tags: "setup-users" -- 2.43.4 From 98336963147150ef1ef91f4b2a0386a62cbd832a Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Fri, 15 Jul 2022 18:03:40 +0200 Subject: [PATCH 4/5] move tags into main.yml instead --- roles/ubuntu_base/tasks/base.yml | 2 -- roles/ubuntu_base/tasks/custom-apt-repos.yml | 3 +-- roles/ubuntu_base/tasks/main.yml | 4 ++++ roles/ubuntu_base/tasks/upgrade.yml | 1 - roles/ubuntu_base/tasks/users.yml | 3 --- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/roles/ubuntu_base/tasks/base.yml b/roles/ubuntu_base/tasks/base.yml index 7d65ccb..257352b 100644 --- a/roles/ubuntu_base/tasks/base.yml +++ b/roles/ubuntu_base/tasks/base.yml @@ -10,7 +10,6 @@ - haveged - mosh - srvadmin-all # Dell OpenManage - tags: install-base-packages - name: Install necessary packages via pip pip: @@ -19,4 +18,3 @@ packages: - docker - docker-compose - tags: install-base-packages diff --git a/roles/ubuntu_base/tasks/custom-apt-repos.yml b/roles/ubuntu_base/tasks/custom-apt-repos.yml index e6e094e..26ff799 100644 --- a/roles/ubuntu_base/tasks/custom-apt-repos.yml +++ b/roles/ubuntu_base/tasks/custom-apt-repos.yml @@ -3,9 +3,8 @@ apt_repository: repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main" state: "present" - tags: setup-custom-apt - name: update apt cache apt: update_cache: yes - tags: setup-custom-apt \ No newline at end of file + \ No newline at end of file diff --git a/roles/ubuntu_base/tasks/main.yml b/roles/ubuntu_base/tasks/main.yml index af771a8..d6d34a4 100644 --- a/roles/ubuntu_base/tasks/main.yml +++ b/roles/ubuntu_base/tasks/main.yml @@ -1,6 +1,10 @@ --- - import_tasks: custom-apt-repos.yml + tags: [setup-custom-apt] - import_tasks: upgrade.yml + tags: [do-full-system-upgrade] - import_tasks: base.yml + tags: [install-base-packages] - import_tasks: users.yml + tags: [setup-users] diff --git a/roles/ubuntu_base/tasks/upgrade.yml b/roles/ubuntu_base/tasks/upgrade.yml index 73d6ec5..c4cd33b 100644 --- a/roles/ubuntu_base/tasks/upgrade.yml +++ b/roles/ubuntu_base/tasks/upgrade.yml @@ -3,4 +3,3 @@ apt: update_cache: yes upgrade: full - tags: "do-full-system-upgrade" diff --git a/roles/ubuntu_base/tasks/users.yml b/roles/ubuntu_base/tasks/users.yml index 2ce0a9d..4e9954c 100644 --- a/roles/ubuntu_base/tasks/users.yml +++ b/roles/ubuntu_base/tasks/users.yml @@ -7,7 +7,6 @@ update_password: "on_create" groups: "{{ item.groups }}" loop: "{{ users | default([]) }}" - tags: "setup-users" - name: "Add ssh authorized_keys" authorized_key: @@ -16,7 +15,6 @@ with_subelements: - "{{ users | default([]) }}" - keys - tags: "setup-users" - name: "Add ssh authorized_keys to root user" authorized_key: @@ -25,4 +23,3 @@ with_subelements: - "{{ users | default([]) }}" - keys - tags: "setup-users" -- 2.43.4 From a495b7bf3b7a8642478cdb03b115d1286b0b5b60 Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Thu, 21 Jul 2022 09:19:36 +0200 Subject: [PATCH 5/5] Add Dell apt signing key --- roles/ubuntu_base/tasks/custom-apt-repos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/ubuntu_base/tasks/custom-apt-repos.yml b/roles/ubuntu_base/tasks/custom-apt-repos.yml index 26ff799..fc1555d 100644 --- a/roles/ubuntu_base/tasks/custom-apt-repos.yml +++ b/roles/ubuntu_base/tasks/custom-apt-repos.yml @@ -1,4 +1,9 @@ --- +- name: import dell apt signing key + apt_key: + id: "1285491434D8786F" + keyserver: "keyserver.ubuntu.com" + - name: "configure dell apt repo" apt_repository: repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main" -- 2.43.4