summaryrefslogtreecommitdiff
path: root/wiki/devops/notes-on-bootstrapping-grimoire-dot-ca.md
blob: 36cea2c084e5b351cff7f06810d172f5f111597c (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Notes on Bootstrapping This Host

Presented without comment:

* Package updates:

        apt-get update
        apt-get upgrade

* Install Git:

        apt-get install git

* Set hostname:

        echo 'grimoire' > /etc/hostname
        sed -i -e $'s,ubuntu,grimoire.ca\tgrimoire,' /etc/hosts
        poweroff

    To verify:

        hostname -f # => grimoire.ca
        hostname    # => grimoire

* Add `owen` user:

        adduser owen
        adduser owen sudo

    To verify:

        id owen # => uid=1000(owen) gid=1000(owen) groups=1000(owen),27(sudo)

* Install Puppetlabs Repos:

        wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
        dpkg -i puppetlabs-release-pc1-trusty.deb
        apt-get update

* Install Puppet server:

        apt-get install puppetserver
        sed -i \
            -e '/^JAVA_ARGS=/ s,2g,512m,g' \
            -e '/^JAVA_ARGS=/ s, -XX:MaxPermSize=256m,,' \
            /etc/default/puppetserver
        service puppetserver start

* Test Puppet agent:

        /opt/puppetlabs/bin/puppet agent --test --server grimoire.ca

    This should output the following:

        Info: Retrieving pluginfacts
        Info: Retrieving plugin
        Info: Caching catalog for grimoire.ca
        Info: Applying configuration version '1446415926'
        Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
        Notice: Applied catalog in 0.01 seconds

* Install environment:

        git init --bare /root/puppet.git
        # From workstation, `git push root@grimoire.ca:puppet.git master` to populate the repo
        rm -rf /etc/puppetlabs/code/environments/production
        git clone /root/puppet.git /etc/puppetlabs/code/environments/production

* Bootstrap puppet:

        /opt/puppetlabs/bin/puppet agent --test --server grimoire.ca