-
Notifications
You must be signed in to change notification settings - Fork 5
/
installer.sh
37 lines (29 loc) · 950 Bytes
/
installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
CONTROL_REPO="https://github.com/puppet-br/pcp-controlrepo"
puppet resource package git ensure=present
puppet resource package vim-enhanced ensure=present
rm -rf /etc/puppetlabs/code/*
rm -rf /etc/puppetlabs/puppet/ssl
/opt/puppetlabs/puppet/bin/gem install --no-ri --no-rdoc r10k
cat > /etc/puppetlabs/code/hiera.yaml <<EOF
---
:backends:
- yaml
:hierarchy:
- "nodes/%{::trusted.certname}"
- "%{::operatingsystem}-%{::operatingsystemmajrelease}"
- "%{::osfamily}-%{::operatingsystemmajrelease}"
- "%{::osfamily}"
- common
EOF
mkdir -p /etc/puppetlabs/r10k
cat > /etc/puppetlabs/r10k/r10k.yaml <<EOF
---
:cachedir: /opt/puppetlabs/server/data/puppetserver/r10k
:sources:
puppet:
basedir: /etc/puppetlabs/code/environments
remote: $CONTROL_REPO
EOF
/opt/puppetlabs/puppet/bin/r10k deploy environment production -v debug --puppetfile
puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp