From 48f15fb381adfa2e75ffda099f54088edec9f7bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 29 Mar 2018 20:34:04 +0200 Subject: [PATCH] Add at daemon, and ensure running service --- .../base_installation/manifests/packages.pp | 3 +++ .../base_installation/manifests/services.pp | 21 ++++++++++++++----- scripts/arch_install_script.sh | 2 ++ scripts/arch_puppet_configuration_script.sh | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/modules/base_installation/manifests/packages.pp b/modules/base_installation/manifests/packages.pp index b0824ad..b0c976f 100644 --- a/modules/base_installation/manifests/packages.pp +++ b/modules/base_installation/manifests/packages.pp @@ -7,4 +7,7 @@ class base_installation::packages inherits base_installation { # Puppet dependencies ensure_packages(['git', 'puppet']) + + # To run jobs + ensure_packages(['at']) } diff --git a/modules/base_installation/manifests/services.pp b/modules/base_installation/manifests/services.pp index 067a8f2..57fbfc3 100644 --- a/modules/base_installation/manifests/services.pp +++ b/modules/base_installation/manifests/services.pp @@ -1,27 +1,38 @@ class base_installation::services inherits base_installation { + if (empty($facts["in_chroot"])) { + $ensure = "running" + } else { + $ensure = undef + } + service { "sshd": - #ensure => "running", + ensure => $ensure, enable => true, } + service { "atd": + ensure => $ensure, + enable => true + } + service { "systemd-networkd": - #ensure => "running", + ensure => $ensure, enable => true, } service { "systemd-resolved": - #ensure => "running", + ensure => $ensure, enable => true, } service { "systemd-timesyncd": - #ensure => "running", + ensure => $ensure, enable => true } service { "cronie": - #ensure => "running", + ensure => $ensure, enable => true, } diff --git a/scripts/arch_install_script.sh b/scripts/arch_install_script.sh index d2c6107..a16b796 100755 --- a/scripts/arch_install_script.sh +++ b/scripts/arch_install_script.sh @@ -10,6 +10,8 @@ pacman-key --init pacman-key --populate archlinux git clone -b $git_branch --recursive https://git.immae.eu/perso/Immae/Projets/Puppet.git $CODE_PATH + +export FACTER_in_chroot="yes" puppet apply --environment $environment --tags base_installation --test $CODE_PATH/manifests/site.pp # The password seed requires puppet to be run twice puppet apply --environment $environment --tags base_installation --test $CODE_PATH/manifests/site.pp diff --git a/scripts/arch_puppet_configuration_script.sh b/scripts/arch_puppet_configuration_script.sh index caf8987..4efb137 100755 --- a/scripts/arch_puppet_configuration_script.sh +++ b/scripts/arch_puppet_configuration_script.sh @@ -4,5 +4,6 @@ git_branch="$1" environment="$2" CODE_PATH="/etc/puppetlabs/code" +export FACTER_in_chroot="yes" puppet apply --environment $environment --tags base_installation --test $CODE_PATH/manifests/site.pp -- 2.41.0