Skip to content

Commit

Permalink
Foss Puppet server setup improvements (#205)
Browse files Browse the repository at this point in the history
* Added jenkins role data

* Fix for #203

* Align data to puppet-psick branch/198 Works for #198

* Updated FOSS setup docs #203
  • Loading branch information
alvagante committed Nov 4, 2017
1 parent a60f456 commit 4af89a0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 20 deletions.
4 changes: 2 additions & 2 deletions bin/puppet_install.sh
Expand Up @@ -100,8 +100,8 @@ setup_apt() {
apt-get update >/dev/null 2>&1

echo_title "Installing Puppet and its dependencies"
apt-get install puppet-agent -y >/dev/null
apt-get install apt-transport-https -y >/dev/null
apt-get install -y puppet-agent -y >/dev/null
apt-get install -y apt-transport-https -y >/dev/null
}
setup_alpine() {
echo "## Adding repo for Ruby to /etc/apk/repositories"
Expand Down
4 changes: 2 additions & 2 deletions bin/puppet_install4.sh
Expand Up @@ -84,8 +84,8 @@ setup_apt() {
apt-get update >/dev/null 2>&1

echo_title "Installing Puppet and its dependencies"
apt-get install puppet-agent -y >/dev/null
apt-get install apt-transport-https -y >/dev/null
apt-get install -y puppet-agent -y >/dev/null
apt-get install -y apt-transport-https -y >/dev/null
}
setup_alpine() {
echo "## Adding repo for Puppet 4 to /etc/apk/repositories"
Expand Down
35 changes: 21 additions & 14 deletions docs/FOSS_puppet_server.md
@@ -1,6 +1,6 @@
## example42 PSICK Puppet Open Source Server automation

The control-repo allows to spin up a Puppet Open Source Server in a fully automated way.
This control-repo allows to spin up a Puppet Open Source Server in a fully automated way.

One can use vagrant or even use PSICK on a fresh base OS installation.

Expand All @@ -18,28 +18,35 @@ Now change to ```vagrant/environments/pos``` directory and run ```vagrant up pup

## Base OS installation

For base OS installation the most easy way is cloning control-repo into /etc/puppetlabs/code/environments/production:
For base OS installation the easiest way is cloning control-repo into /etc/puppetlabs/code/environments/production:

mkdir -p /etc/puppetlabs/code/environments
cd /etc/puppetlabs/code/environments
git clone https://github.com/example42/psick.git production
cd production

Next it is required tp have puppet-agent package already installed. This can be achieved by running ```bin/puppet_install.sh``` from PSICK base directory.
Next we need r10k installation by running ```bin/puppet_setup.sh``` from PSICK base directory.
Next it is required to have puppet-agent package already installed. We can install Puppet 5 agent running from PSICK base directory:

One can ignore error message concerning docker, vagrant and fab.
bin/puppet_install.sh

Now we can install modules by using the r10k command to install required modules:
Next we need to install r10k gem by running

./bin/puppet_install_puppetfile.sh
bin/puppet_setup.sh

Afterwards one needs to change the hiera node data to add the profile classification information:
We can ignore warnings about missing docker, vagrant and fab command.

---
psick::profiles::linux_classes:
puppet_gems: psick::puppet::gems
puppet_master: psick::puppet::foss_master
psick::puppet::gems::install_puppetserver_gems: true
Then, if not done via the puppet_setups.sh script, we have to install the modules defined in ```Puppetfile``` under the ```modules``` directory by using the r10k command:

Last step is to use puppet apply for getting the setup done automatically. Just run ```bin/papply.sh```.
bin/puppet_install_puppetfile.sh

Now we are ready to assume the ```puppet_foss_master``` role and run Puppet locally, we do this setting as environment variable the role fact:

export FACTER_role=puppet_foss_master

Finally just run:

bin/papply.sh

to setup locally, via Puppet, a Puppet Server with PuppetDB. If you have errors at the first run (known ones are related to the used postgresql module) run the command again, until you see no changes on the system:

bin/papply.sh
4 changes: 2 additions & 2 deletions hieradata/role/ci.yaml
@@ -1,4 +1,4 @@
---
psick::profiles::linux_classes:
jenkins: psick::ci::jenkins
gitlab: psick::gitlab
jenkins: psick::jenkins
# gitlab: psick::gitlab
6 changes: 6 additions & 0 deletions hieradata/role/jenkins.yaml
@@ -0,0 +1,6 @@
psick::profiles::linux_classes:
jenkins: psick::jenkins

psick::jenkins::plugins:
scm-sync-configuration:
enable: true
5 changes: 5 additions & 0 deletions hieradata/role/puppet_foss_master.yaml
@@ -0,0 +1,5 @@
---
psick::profiles::linux_classes:
puppet_gems: psick::puppet::gems
puppet_master: psick::puppet::foss_master
psick::puppet::gems::install_puppetserver_gems: true
1 change: 1 addition & 0 deletions hieradata/zone/lab.yaml
Expand Up @@ -43,6 +43,7 @@ psick::sensu::rabbitmq_password: 'hiera_encrypt_in_the_real_world'
psick::sensu::rabbitmq_vhost: '/sensu'
psick::sensu::api_user: 'admin'
psick::sensu::api_password: 'sensu' # In real world encrypt with hiera eyaml

#sensu::client_http_socket:
# bind: "%{facts.networking.ip}"
# port: 3031
Expand Down
3 changes: 3 additions & 0 deletions vagrant/environments/foss/config.yaml
Expand Up @@ -72,6 +72,9 @@ nodes:
- role: docker
count: 1
box: ubuntu1604
- role: jenkins
count: 1
box: ubuntu1604
- role: ostest
hostname_base: centos6
count: 1
Expand Down

0 comments on commit 4af89a0

Please sign in to comment.