1.6 KiB
1.6 KiB
Linux+ 4.1.2: Puppet and OpenTofu
A Puppet manifest applied without a server, and an OpenTofu configuration planned, applied and destroyed with a provider that needs no cloud account.
Before you start
Work as root, so ~ is /root. The VM needs internet access to add the
OpenVox and OpenTofu package repositories. The lab only checks that
~/lab.pp, ~/tofu and /tmp/puppet-lab.txt don't exist yet.
le-lab reset removes those files but leaves the packages installed.
Tasks
- Add the OpenVox 8 repository for your system (see voxpupuli.org) and
install
openvox-agent. Write~/lab.pp, a manifest that manages/tmp/puppet-lab.txtwith mode 0644 and the contentManaged by Puppet on <OS name>(from theos.namefact). Apply it with--noopfirst, then for real, and ask facter foros.family. - Install OpenTofu from opentofu.org's packages. In
~/tofu, write amain.tfwith aterraform_dataresource namedhellowhose input ishello from OpenTofu, and an outputmsgwith its output. Runtofu init,planandapply, look at the state, and then destroy it.
Hints
- The release package
openvox8-release-el-10.noarch.rpm(oropenvox8-release-ubuntu24.04.deb), thenopenvox-agent;/opt/puppetlabs/bin/puppet apply --noop,/opt/puppetlabs/bin/facter. - A
file { '/tmp/puppet-lab.txt': ... }resource withensure,contentandmode;${facts['os']['name']}in a double-quoted string. - The installer script
install-opentofu.shwith--install-method rpmordeb;tofu init,tofu plan,tofu apply -auto-approve,tofu state list,tofu destroy -auto-approve.