Compare commits
4 Commits
93cadce4fe
...
fcdc7d07ad
Author | SHA1 | Date | |
---|---|---|---|
fcdc7d07ad | |||
998f5ef381 | |||
a9041b19a4 | |||
0a2647d465 |
@@ -1,2 +1,3 @@
|
|||||||
[defaults]
|
[defaults]
|
||||||
remote_tmp = /tmp/.ansible-${USER}/tmp
|
deprecation_warnings = False
|
||||||
|
remote_tmp = /tmp/.ansible-${USER}/tmp
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- hosts: 127.0.0.1
|
||||||
|
connection: local
|
||||||
|
gather_facts: false
|
||||||
|
# become: true
|
||||||
|
roles:
|
||||||
|
- vapp
|
||||||
|
- network
|
@@ -0,0 +1,41 @@
|
|||||||
|
- name: Store current vApp configuration
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: vmtoolsd --cmd "info-get guestinfo.ovfEnv"
|
||||||
|
register: ovfEnv
|
||||||
|
- name: Parse XML into variables
|
||||||
|
community.general.xml:
|
||||||
|
xmlstring: "{{ ovfEnv }}"
|
||||||
|
namespaces:
|
||||||
|
oe: http://schemas.dmtf.org/ovf/environment/1
|
||||||
|
xpath: /Environment/PropertySection/Property
|
||||||
|
content: oe:key
|
||||||
|
|
||||||
|
|
||||||
|
# <?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
# <Environment
|
||||||
|
# xmlns="http://schemas.dmtf.org/ovf/environment/1"
|
||||||
|
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
# xmlns:oe="http://schemas.dmtf.org/ovf/environment/1"
|
||||||
|
# xmlns:ve="http://www.vmware.com/schema/ovfenv"
|
||||||
|
# oe:id=""
|
||||||
|
# ve:vCenterId="vm-1171">
|
||||||
|
# <PlatformSection>
|
||||||
|
# <Kind>VMware ESXi</Kind>
|
||||||
|
# <Version>7.0.1</Version>
|
||||||
|
# <Vendor>VMware, Inc.</Vendor>
|
||||||
|
# <Locale>en</Locale>
|
||||||
|
# </PlatformSection>
|
||||||
|
# <PropertySection>
|
||||||
|
# <Property oe:key="deployment.type" oe:value="ubuntu-small"/>
|
||||||
|
# <Property oe:key="guestinfo.dnsserver" oe:value="1.1.1.1"/>
|
||||||
|
# <Property oe:key="guestinfo.gateway" oe:value="10.0.0.1"/>
|
||||||
|
# <Property oe:key="guestinfo.hostname" oe:value="SRV01"/>
|
||||||
|
# <Property oe:key="guestinfo.ipaddress" oe:value="10.0.0.84"/>
|
||||||
|
# <Property oe:key="guestinfo.ntpserver" oe:value="0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org"/>
|
||||||
|
# <Property oe:key="guestinfo.prefixlength" oe:value="24"/>
|
||||||
|
# <Property oe:key="guestinfo.rootpw" oe:value=""/>
|
||||||
|
# </PropertySection>
|
||||||
|
# <ve:EthernetAdapterSection>
|
||||||
|
# <ve:Adapter ve:mac="00:50:56:8a:09:08" ve:network="Staging" ve:unitNumber="7"/>
|
||||||
|
# </ve:EthernetAdapterSection>
|
||||||
|
# </Environment>
|
@@ -1,7 +1,7 @@
|
|||||||
- name: Copy firstboot script file
|
- name: Create firstboot script file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.template:
|
||||||
src: firstboot.sh
|
src: firstboot.j2
|
||||||
dest: /opt/firstboot.sh
|
dest: /opt/firstboot/firstboot.sh
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: o+x
|
mode: o+x
|
||||||
@@ -9,4 +9,14 @@
|
|||||||
ansible.builtin.cron:
|
ansible.builtin.cron:
|
||||||
name: "firstboot"
|
name: "firstboot"
|
||||||
special_time: reboot
|
special_time: reboot
|
||||||
job: "/opt/firstboot.sh"
|
job: "/opt/firstboot/firstboot.sh"
|
||||||
|
- name: Copy payload folder
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ansible_payload/
|
||||||
|
dest: /opt/firstboot/ansible/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
- name: Install ansible-galaxy collection
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: ansible-galaxy collection install community.general
|
@@ -1,9 +1,6 @@
|
|||||||
#cloud-config
|
#cloud-config
|
||||||
autoinstall:
|
autoinstall:
|
||||||
version: 1
|
version: 1
|
||||||
# early-commands:
|
|
||||||
# # Block inbound SSH to stop Packer trying to connect during initial install
|
|
||||||
# - iptables -A INPUT -p tcp --dport 22 -j DROP
|
|
||||||
locale: en_US
|
locale: en_US
|
||||||
keyboard:
|
keyboard:
|
||||||
layout: en
|
layout: en
|
||||||
@@ -24,8 +21,6 @@ autoinstall:
|
|||||||
ssh:
|
ssh:
|
||||||
install-server: yes
|
install-server: yes
|
||||||
allow-pw: true
|
allow-pw: true
|
||||||
# authorized-keys:
|
|
||||||
# - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCi9eAu6KBaShdcL4pxi6/sJp+IS6nCKexcjQdwFLxg+EoiT2MTAnMsjnfi570het+VV+iOigcZLuRwEcAPh6rSQOtpikmpV6WFjzToWq9aUxDrxWsp/iEPHp+sbjrlsdnGvLGY9XhmPs9s5I8xFQbwF6ilhMIQm+RxtGJJuPUWaF+uXo+3CB91A6bK/rjs97iAjrPZRs0vo5hJGqrIGFi3WP9hf8hF9oWz2BiLRYBib3il6lsAl4Ca0sI//gNM0Ztj4gB7qv1+uPz157bk0IZoN285/72l/rUZVSPIwO+QFZFK07FsyVrpAgMlHk65BiSAO4DtolZEArfXRE1g1DH/ mail@example.com
|
|
||||||
user-data:
|
user-data:
|
||||||
disable_root: false
|
disable_root: false
|
||||||
late-commands:
|
late-commands:
|
||||||
|
@@ -88,7 +88,7 @@ build {
|
|||||||
" -ManifestFileName '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.mf'",
|
" -ManifestFileName '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.mf'",
|
||||||
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
||||||
" '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.ovf' \\",
|
" '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.ovf' \\",
|
||||||
" /output/UbuntuServer20.04.ova"
|
" /output/Ubuntu-Server-20.04.ova"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,30 +1,26 @@
|
|||||||
DeploymentConfigurations:
|
DeploymentConfigurations:
|
||||||
- Id: ubuntu-small
|
- Id: small
|
||||||
Label: 'Ubuntu Server 20.04 [SMALL]'
|
Label: 'Ubuntu Server 20.04 [SMALL: 1 vCPU/2GB RAM]'
|
||||||
Description: |
|
Description: Ubuntu Server 20.04.x
|
||||||
Ubuntu Server 20.04
|
|
||||||
1 vCPU/2GB RAM
|
|
||||||
Size:
|
Size:
|
||||||
CPU: 1
|
CPU: 1
|
||||||
Memory: 2048
|
Memory: 2048
|
||||||
- Id: ubuntu-large
|
- Id: large
|
||||||
Label: 'Ubuntu Server 20.04 [LARGE]'
|
Label: 'Ubuntu Server 20.04 [LARGE: 4 vCPU/8GB RAM]'
|
||||||
Description: |
|
Description: Ubuntu Server 20.04.x
|
||||||
Ubuntu Server 20.04
|
|
||||||
4 vCPU/8GB RAM
|
|
||||||
Size:
|
Size:
|
||||||
CPU: 4
|
CPU: 4
|
||||||
Memory: 8192
|
Memory: 8192
|
||||||
DynamicDisks: []
|
DynamicDisks: []
|
||||||
PropertyCategories:
|
PropertyCategories:
|
||||||
- Name: 0) Deployment information
|
# - Name: 0) Deployment information
|
||||||
ProductProperties:
|
# ProductProperties:
|
||||||
- Key: deployment.type
|
# - Key: deployment.type
|
||||||
Type: string
|
# Type: string
|
||||||
Value:
|
# Value:
|
||||||
- ubuntu-small
|
# - small
|
||||||
- ubuntu-large
|
# - large
|
||||||
UserConfigurable: false
|
# UserConfigurable: false
|
||||||
- Name: 1) Operating System
|
- Name: 1) Operating System
|
||||||
ProductProperties:
|
ProductProperties:
|
||||||
- Key: guestinfo.hostname
|
- Key: guestinfo.hostname
|
||||||
|
Reference in New Issue
Block a user