Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: hiera/install_precise.py

Issue 29337844: Issue 3706 - Include APT pin for package facter in Puppet/Hiera setup script (Closed)
Patch Set: Created March 1, 2016, 3:41 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import distutils.spawn 3 import distutils.spawn
4 import io 4 import io
5 import os 5 import os
6 import subprocess 6 import subprocess
7 import sys 7 import sys
8 8
9 if distutils.spawn.find_executable('puppet') \ 9 if distutils.spawn.find_executable('puppet') \
10 and distutils.spawn.find_executable('hiera'): 10 and distutils.spawn.find_executable('hiera'):
11 sys.exit(os.EX_OK) 11 sys.exit(os.EX_OK)
12 12
13 PUPPETLABS_SOURCES = ''' 13 PUPPETLABS_SOURCES = '''
14 deb http://apt.puppetlabs.com precise main 14 deb http://apt.puppetlabs.com precise main
15 deb-src http://apt.puppetlabs.com precise main''' 15 deb-src http://apt.puppetlabs.com precise main'''
16 16
17 PUPPETLABS_PREFS = ''' 17 PUPPETLABS_PREFS = '''
18 # Puppetlabs packages (e.g. hiera) would attempt to install a puppet 3.x 18 # Puppetlabs packages (e.g. hiera) would attempt to install a puppet 3.x
19 # or later release (which is not available in precise) if not pinned here 19 # or later release (which is not available in precise) if not pinned here
20 Package: puppet puppet-common 20 Package: puppet puppet-common
21 Pin: version 2.7.26-* 21 Pin: version 2.7.26-*
22 Pin-Priority: 501
23
24 # See https://issues.adblockplus.org/ticket/3706#comment:4
25 Package: facter
26 Pin: version 1.*
22 Pin-Priority: 501''' 27 Pin-Priority: 501'''
23 28
24 PUPPETLABS_GPG_KEY = ''' 29 PUPPETLABS_GPG_KEY = '''
25 -----BEGIN PGP PUBLIC KEY BLOCK----- 30 -----BEGIN PGP PUBLIC KEY BLOCK-----
26 Version: GnuPG v1.4.12 (GNU/Linux) 31 Version: GnuPG v1.4.12 (GNU/Linux)
27 Comment: GPGTools - http://gpgtools.org 32 Comment: GPGTools - http://gpgtools.org
28 33
29 mQINBEw3u0ABEAC1+aJQpU59fwZ4mxFjqNCgfZgDhONDSYQFMRnYC1dzBpJHzI6b 34 mQINBEw3u0ABEAC1+aJQpU59fwZ4mxFjqNCgfZgDhONDSYQFMRnYC1dzBpJHzI6b
30 fUBQeaZ8rh6N4kZ+wq1eL86YDXkCt4sCvNTP0eF2XaOLbmxtV9bdpTIBep9bQiKg 35 fUBQeaZ8rh6N4kZ+wq1eL86YDXkCt4sCvNTP0eF2XaOLbmxtV9bdpTIBep9bQiKg
31 5iZaz+brUZlFk/MyJ0Yz//VQ68N1uvXccmD6uxQsVO+gx7rnarg/BGuCNaVtGwy+ 36 5iZaz+brUZlFk/MyJ0Yz//VQ68N1uvXccmD6uxQsVO+gx7rnarg/BGuCNaVtGwy+
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 subprocess.check_call(['apt-get', '-y', 'install', 102 subprocess.check_call(['apt-get', '-y', 'install',
98 '-o', 'Dpkg::Options::=--force-overwrite', 103 '-o', 'Dpkg::Options::=--force-overwrite',
99 'puppet', 'puppet-common', 'hiera-puppet']) 104 'puppet', 'puppet-common', 'hiera-puppet'])
100 105
101 if not os.path.exists('/etc/puppet/hiera.yaml'): 106 if not os.path.exists('/etc/puppet/hiera.yaml'):
102 realpath = os.path.realpath(__file__) 107 realpath = os.path.realpath(__file__)
103 dirname = os.path.dirname(realpath) 108 dirname = os.path.dirname(realpath)
104 config = os.path.join(dirname, 'hiera.yaml') 109 config = os.path.join(dirname, 'hiera.yaml')
105 if os.path.exists(config): 110 if os.path.exists(config):
106 os.symlink(config, '/etc/puppet/hiera.yaml') 111 os.symlink(config, '/etc/puppet/hiera.yaml')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld