Browse Source

Merge "Skip installing puppetlabs repos if they exist"

Zuul 1 month ago
parent
commit
2da4255e33

+ 14
- 0
roles/puppet-install/tasks/puppet-install/trusty.yaml View File

@@ -24,9 +24,23 @@
24 24
   when: puppet_install_version == 4
25 25
   become: true
26 26
   block:
27
+
28
+    # The puppetlabs-release-pc1 deb install below unfortunatley isn't
29
+    # idempotent.  If you install the puppet repo with this deb and
30
+    # then upgrade, you pull in a new version of
31
+    # puppetlabs-release-pc1 ... now ansible gets upset because we're
32
+    # trying to downgrade the package.  This could be fixed by puppet
33
+    # symlinking the version at the top-level to the latest .deb
34
+    # ... or we just skip installing it if we seem to have the repo
35
+    # already.
36
+    - name: "Check for puppet 4 repo"
37
+      stat:
38
+        path: /etc/apt/sources.list.d/puppetlabs-pc1.list
39
+      register: puppet4_repo
27 40
     - name: Install puppetlabs repo
28 41
       apt:
29 42
         deb: http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
43
+      when: not puppet4_repo.stat.exists
30 44
 
31 45
     - name: Install puppet packages
32 46
       apt:

+ 14
- 0
roles/puppet-install/tasks/puppet-install/xenial.yaml View File

@@ -19,9 +19,23 @@
19 19
   when: puppet_install_version == 4
20 20
   become: true
21 21
   block:
22
+
23
+    # The puppetlabs-release-pc1 deb install below unfortunatley isn't
24
+    # idempotent.  If you install the puppet repo with this deb and
25
+    # then upgrade, you pull in a new version of
26
+    # puppetlabs-release-pc1 ... now ansible gets upset because we're
27
+    # trying to downgrade the package.  This could be fixed by puppet
28
+    # symlinking the version at the top-level to the latest .deb
29
+    # ... or we just skip installing it if we seem to have the repo
30
+    # already.
31
+    - name: "Check for puppet 4 repo"
32
+      stat:
33
+        path: /etc/apt/sources.list.d/puppetlabs-pc1.list
34
+      register: puppet4_repo
22 35
     - name: Install puppetlabs repo
23 36
       apt:
24 37
         deb: https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
38
+      when: not puppet4_repo.stat.exists
25 39
 
26 40
     - name: Install puppet packages
27 41
       apt:

Loading…
Cancel
Save