-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit_db.tpl
32 lines (27 loc) · 929 Bytes
/
init_db.tpl
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
#!/bin/bash
echo "Start of boot script"
export FACTER_monitor_address="${monitor_address}"
echo "Rsyslog server is: $FACTER_monitor_address"
echo "Create hiera directories"
mkdir -p /etc/puppetlabs/puppet
mkdir -p /etc/puppetlabs/code/environments/production/hieradata
echo "Write hiera.yaml /etc/puppetlabs/puppet/hiera.yaml"
cat <<'EOF' >> /etc/puppetlabs/puppet/hiera.yaml
---
:backends:
- json
- yaml
:hierarchy:
- "nodes/%{::trusted.certname}"
- customer
- relybv
- common
:yaml:
:datadir: "/etc/puppetlabs/code/environments/production/hieradata"
:json:
:datadir: "/etc/puppetlabs/code/environments/production/hieradata"
EOF
echo "Write customer hieradata"
echo '${file("customer.json")}' > "/etc/puppetlabs/code/environments/production/hieradata/customer.json"
echo "Bootstrap puppet and apply role"
wget https://raw.githubusercontent.com/relybv/dirict-role_db/master/files/bootme.sh && bash bootme.sh