Commit f8cd876c authored by James T. Lee's avatar James T. Lee
Browse files

puppet: Let r10k deploy private repo with rugged

parent 654e6aaf
.bundle/ .bundle/
Gemfile.lock Gemfile.lock
vendor/ vendor/
modules/nest_private
...@@ -22,3 +22,7 @@ nest::package_keywords: ...@@ -22,3 +22,7 @@ nest::package_keywords:
dev-ruby/puppet_forge: {} dev-ruby/puppet_forge: {}
dev-ruby/rash_alt: {} dev-ruby/rash_alt: {}
dev-ruby/simple_oauth: {} dev-ruby/simple_oauth: {}
# For rugged
dev-libs/libgit2:
version: '~1.1.0'
../modules/nest_private/data
\ No newline at end of file
...@@ -10,14 +10,26 @@ defaults: ...@@ -10,14 +10,26 @@ defaults:
hierarchy: hierarchy:
- name: 'Nodes' - name: 'Nodes'
path: "node/%{::trusted.certname}.yaml" paths:
- "private/node/%{::trusted.certname}.yaml"
- "node/%{::trusted.certname}.yaml"
- name: 'Roles' - name: 'Roles'
path: "role/%{::role}.yaml" paths:
- "private/role/%{::role}.yaml"
- "role/%{::role}.yaml"
- name: 'Platforms' - name: 'Platforms'
path: "platform/%{::platform}.yaml" paths:
- "private/platform/%{::platform}.yaml"
- "platform/%{::platform}.yaml"
- name: 'Architectures' - name: 'Architectures'
path: "arch/%{::architecture}.yaml" paths:
- "private/arch/%{::architecture}.yaml"
- "arch/%{::architecture}.yaml"
- name: 'Operating Systems' - name: 'Operating Systems'
path: "os/%{::facts.osfamily}.yaml" paths:
- "private/os/%{::facts.osfamily}.yaml"
- "os/%{::facts.osfamily}.yaml"
- name: 'Common' - name: 'Common'
path: 'common.yaml' paths:
- 'private/common.yaml'
- 'common.yaml'
--- ---
cachedir: '/var/cache/r10k' cachedir: '/var/cache/r10k'
git:
provider: 'rugged'
private_key: '/etc/puppetlabs/r10k/id_rsa'
sources: sources:
main: nest:
remote: 'https://gitlab.james.tl/nest/puppet-nest.git' remote: 'https://gitlab.james.tl/nest/puppet-nest.git'
basedir: '/etc/puppetlabs/code/environments' basedir: '/etc/puppetlabs/code/environments'
class nest::node::puppet { class nest::node::puppet (
String[1] $r10k_deploy_key,
) {
nest::lib::srv { 'puppetserver': } nest::lib::srv { 'puppetserver': }
file { '/srv/puppetserver/hiera.yaml': file { '/srv/puppetserver/hiera.yaml':
...@@ -6,22 +8,41 @@ class nest::node::puppet { ...@@ -6,22 +8,41 @@ class nest::node::puppet {
require => Nest::Lib::Srv['puppetserver'], require => Nest::Lib::Srv['puppetserver'],
} }
package { 'r10k': package { 'libgit2':
ensure => installed, ensure => installed,
} }
file { '/etc/puppetlabs/r10k': package { 'rugged':
ensure => directory, ensure => installed,
mode => '0755', install_options => ['--use-system-libraries'],
owner => 'root', provider => gem,
group => 'root', require => Package['libgit2'],
} }
file { '/etc/puppetlabs/r10k/r10k.yaml': package { 'r10k':
mode => '0644', ensure => installed,
owner => 'root', }
group => 'root',
source => 'puppet:///modules/nest/puppet/r10k.yaml', file {
default:
owner => 'root',
group => 'root',
;
'/etc/puppetlabs/r10k':
mode => '0755',
ensure => directory,
;
'/etc/puppetlabs/r10k/r10k.yaml':
mode => '0644',
source => 'puppet:///modules/nest/puppet/r10k.yaml',
;
'/etc/puppetlabs/r10k/id_rsa':
mode => '0600',
content => $r10k_deploy_key,
;
} }
file { '/etc/eyaml': file { '/etc/eyaml':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment