From 1b7a898c7a336778c0e43ce6e26a36e43cf1080b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 21 Jun 2023 21:45:18 +0200 Subject: Remove everything. Remove everything in the module, to make room for a new module in its place (but keeping the history, just in case). The problem with this module was that it tried way to hard to handle the machines by itself, while that should be done outside puppet. The new module will have a much simpler idea of how to provission, not attempt to build machines from scratch, and especially not do anything expensive. --- manifests/os/arch.pp | 17 -------------- manifests/os/debian.pp | 61 -------------------------------------------------- 2 files changed, 78 deletions(-) delete mode 100644 manifests/os/arch.pp delete mode 100644 manifests/os/debian.pp (limited to 'manifests/os') diff --git a/manifests/os/arch.pp b/manifests/os/arch.pp deleted file mode 100644 index d9bd258..0000000 --- a/manifests/os/arch.pp +++ /dev/null @@ -1,17 +0,0 @@ -define nspawn::os::arch ( - String $template_name = $name, - String $template_dir = $nspawn::template_dir, -) { - - ensure_packages(['arch-install-scripts']) - - $root = "${template_dir}/${template_name}" - - file { $root: - ensure => directory, - } -> exec { "/usr/bin/pacstrap '${root}' base puppet": - creates => "${root}/etc/os-release", - } -> nspawn::util::enable_networkd { $template_name: - template_dir => $template_dir, - } -} diff --git a/manifests/os/debian.pp b/manifests/os/debian.pp deleted file mode 100644 index 9e42737..0000000 --- a/manifests/os/debian.pp +++ /dev/null @@ -1,61 +0,0 @@ -# TODO rename this to image-setup -define nspawn::os::debian ( - String $os_version, - String $template_name = $name, - String $template_dir = $nspawn::template_dir, -) { - - $root = "${template_dir}/${template_name}" - $pkg_pos = 'var/tmp' - - ensure_packages(['debootstrap']) - - exec { "/usr/bin/deboostrap ${os_version} '${root}'": - creates => "${root}/etc/os-release", - } - - $puppet_deb = "puppet7-release-${os_version}.deb" - $puppet_deb_path = "${root}/${pkg_pos}/${puppet_deb}" - - file { $puppet_deb_path: - ensure => file, - source => "https://apt.puppet.com/${puppet_deb}" - } - - $running = $facts['machined-info'][$template_name] != undef - and $facts['machined-info'][$template_name]['State'] == 'running' - - if $running { - # TODO - notify { "Notify skipping ${template_name} setup": - message => "Skipping setup for ${template_name}, already running", - } - } else { - exec { "Set up puppet repo for ${template_name}": - subscribe => File[$puppet_deb_path], - refreshonly => true, - command => [ '/usr/bin/systemd-nspawn', - '-M', $template_name, - '--quiet', - '/bin/sh', '-c', - "dpkg -i '/${pkg_pos}/puppet7-release-${os_version}.deb' && apt update" - ], - } - - exec { "install puppet-agent on ${template_name}": - command => [ '/usr/bin/systemd-nspawn', - '-M', $template_name, - '--quiet', - 'apt', 'install', 'puppet-agent', - ], - creates => "${root}/opt/puppetlabs/bin/puppet", - } - } - - nspawn::util::disable_networking { $template_name: - template_dir => $template_dir, - } - nspawn::util::enable_networkd { $template_name: - template_dir => $template_dir, - } -} -- cgit v1.2.3