--- /dev/null
+---
+defaults:
+ vsphere: test
+ cluster: test-vmcc-l105-01
+ vm_folder: pp-user/frank.brehm
+ num_cpus: 2
+ memory: 4GB
+ boot_delay: 5
+ datastore_cluster: Daten-Cluster-Gold_01
+ datastore_type: ssd
+ template: rhel9-dev-template
+ root_disk:
+ size: 20
+ customer: Digitas Pixelpark GmbH
+ purpose: Test VM w/o Puppet with Terraform
+ has_puppet: false
+ puppet:
+ customer: pixelpark
+ project: test
+ tier: development
+ environment: dev_fbrehm
+ contact: solution@pixelpark.com
+ role: dpx_infra::test_deploy
+ initial-install: false
+ nameservers:
+ - 93.188.109.13
+ - 77.74.232.25
+ - 217.66.52.10
+ searchdomains:
+ - pixelpark.com
+ - pixelpark.net
+ - pixelpark.de
+ dns_options: 'timeout:1 attempts:2 use-vc'
+
+vms:
+ - name: dev-really-blank-rhel9.pixelpark.com
+ interfaces:
+ - address_v4: 192.168.145.53
from ..xlate import XLATOR
-__version__ = '0.4.1'
+__version__ = '0.4.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
files.append('register-rhel')
if vm.has_puppet:
files.append('init-puppet')
- files.append('update-all-packages')
+ files.append('update-all-packages')
for sname in files:
# ## postconfigure actions with puppet
if vm.has_puppet:
content += self._create_instfile_puppet(vm)
+ else:
+ content += self._only_update_packages(vm)
# ## Unregistring from RedHat Subscription Management
cmd = ('if [ -x /sbin/subscription-manager ] ; then '
return content
+ # -------------------------------------------------------------------------ยท
+ def _only_update_packages(self, vm):
+
+ content = textwrap.indent(textwrap.dedent('''\
+ provisioner "remote-exec" {{
+ inline = [
+ "chmod +x /tmp/update-all-packages",
+ "/tmp/update-all-packages",
+ "rm -fv /tmp/update-all-packages /tmp/functions.rc",
+ ]
+ connection {{
+ type = "ssh"
+ host = "{h}"
+ user = "root"
+ private_key = file("{k}")
+ agent = "false"
+ }}
+ }}
+
+ '''), ' ').format(h=vm.fqdn, k=self.private_key_rel)
+
+ return content
+
# =============================================================================