diff --git a/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/files/mongo-update.sh b/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/files/mongo-update.sh new file mode 100644 index 0000000..903817b --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/files/mongo-update.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +sudo apt-key list | \ + grep "expired: " | \ + sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \ + xargs -n1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys + diff --git a/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml b/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml index 1f36ca0..7567c65 100755 --- a/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml +++ b/install/usr/share/swarmlab.io/sec/project/courses/mongodb-org-shell/mongodb-org-shell.yml @@ -10,7 +10,7 @@ - name: apt mongo key become: true apt_key: - id: 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 + id: 6494C6D6997C215E keyserver: keyserver.ubuntu.com - name: apt mongo repo @@ -19,6 +19,24 @@ repo: deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse state: present + # ------------------------ + # cp update file mongo keys + # ------------------------- + - name: cp mongo update file + become: true + copy: + src: "./files/mongo-update.sh" + dest: /project/mongo-update.sh + owner: docker + group: docker + mode: 0755 + + # ------------------------ + # start update.sh + # ------------------------- + - name: start mongo update file + shell: /project/mongo-update.sh -vv /dev/null 2>&1 + # ------------------------ # apt update # -------------------------