From: Ismaƫl Bouya Date: Sun, 10 Sep 2017 10:45:41 +0000 (+0200) Subject: Make use of LDAP variables to configure node X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=503e4cf5c54e3fe4b802038e8917341c4ce803e5;p=perso%2FImmae%2FProjets%2FPuppet.git Make use of LDAP variables to configure node --- diff --git a/bin/install_script.sh b/bin/install_script.sh index f250285..f46ab29 100755 --- a/bin/install_script.sh +++ b/bin/install_script.sh @@ -20,9 +20,12 @@ ARCH_DIR=`mktemp -d` ARCH_HOST_SCRIPT="$ARCH_DIR/arch_host_script.sh" ARCH_CHROOT_SCRIPT="$ARCH_DIR/arch_chroot_script.sh" ARCH_INSTALL_SCRIPT="$ARCH_DIR/arch_install_script.sh" +ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT="$ARCH_DIR/arch_host_puppet_configuration_script.sh" +ARCH_PUPPET_CONFIGURATION_SCRIPT="$ARCH_DIR/arch_puppet_configuration_script.sh" trap "rm -rf $ARCH_DIR" EXIT +#### Base installation stage cat > $ARCH_HOST_SCRIPT < $ARCH_PUPPET_CONFIGURATION_SCRIPT < $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT < root, group => root, } - cron { 'puppet-apply': + cron { 'puppet-pull-apply': ensure => present, command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull", user => root, minute => '*/30', require => File['post-hook'], } + cron { 'puppet-apply': + ensure => present, + command => "cd $base_installation::puppet_code_path ; puppet apply --test $base_installation::puppet_code_path/manifests/site.pp", + user => root, + minute => '*/20' + } } } diff --git a/modules/base_installation/templates/puppet/host_ldap.info.erb b/modules/base_installation/templates/puppet/host_ldap.info.erb index a350c37..f742da7 100644 --- a/modules/base_installation/templates/puppet/host_ldap.info.erb +++ b/modules/base_installation/templates/puppet/host_ldap.info.erb @@ -2,6 +2,7 @@ ldapadd -D "cn=root,<%= @ldap_base %>" -W << 'EOF' dn: <%= @ldap_dn %> cn: <%= @ldap_cn %> +cn: <%= @system_hostname %> objectclass: device objectclass: top objectclass: simpleSecurityObject diff --git a/modules/base_installation/templates/puppet/puppet.conf.erb b/modules/base_installation/templates/puppet/puppet.conf.erb index 99d9fc3..3748039 100644 --- a/modules/base_installation/templates/puppet/puppet.conf.erb +++ b/modules/base_installation/templates/puppet/puppet.conf.erb @@ -2,6 +2,7 @@ ssldir = <%= @puppet_ssl_path %> node_terminus = ldap +certname = <%= @system_hostname %> ldapserver = <%= @ldap_server %> ldaptls = true ldapbase = <%= @ldap_base %>