This commit is contained in:
parent
03b5338f59
commit
d680b0dde4
5
ansible/playbook.yml
Normal file
5
ansible/playbook.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
gather_facts: false
|
||||||
|
roles:
|
||||||
|
- os
|
14
ansible/roles/os/tasks/main.yml
Normal file
14
ansible/roles/os/tasks/main.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- name: Delete cloud-init package
|
||||||
|
apt:
|
||||||
|
name: cloud-init
|
||||||
|
state: absent
|
||||||
|
purge: yes
|
||||||
|
autoclean: yes
|
||||||
|
autoremove: yes
|
||||||
|
- name: Delete cloud-init files
|
||||||
|
file:
|
||||||
|
path: {{ item }}
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- /etc/cloud
|
||||||
|
- /var/lib/cloud
|
@ -20,7 +20,7 @@ autoinstall:
|
|||||||
identity:
|
identity:
|
||||||
hostname: packer-template
|
hostname: packer-template
|
||||||
username: ubuntu
|
username: ubuntu
|
||||||
password: $6$E.3LG7StnEURoOWy$PTcyaJyS5HHFExctu5hWd.oH0LapJ9gXzUd62QfVDjza4rfrEy61NVLmlGE40R7eSBvWBkISvRabc2y0NQ/sy0
|
password: $6$rounds=4096$ZKfzRoaQOtc$M.fhOsI0gbLnJcCONXz/YkPfSoefP4i2/PQgzi2xHEi2x9CUhush.3VmYKL0XVr5JhoYvnLfFwqwR/1YYEqZy/
|
||||||
ssh:
|
ssh:
|
||||||
install-server: yes
|
install-server: yes
|
||||||
allow-pw: true
|
allow-pw: true
|
||||||
|
@ -27,8 +27,7 @@ source "vsphere-iso" "ubuntuserver" {
|
|||||||
|
|
||||||
communicator = "ssh"
|
communicator = "ssh"
|
||||||
ssh_username = "ubuntu"
|
ssh_username = "ubuntu"
|
||||||
ssh_password = "ubuntu"
|
ssh_password = var.ssh_password
|
||||||
// ssh_password = var.ssh_password
|
|
||||||
ssh_timeout = "20m"
|
ssh_timeout = "20m"
|
||||||
ssh_handshake_attempts = "100"
|
ssh_handshake_attempts = "100"
|
||||||
ssh_pty = true
|
ssh_pty = true
|
||||||
@ -68,10 +67,9 @@ source "vsphere-iso" "ubuntuserver" {
|
|||||||
build {
|
build {
|
||||||
sources = ["source.vsphere-iso.ubuntuserver"]
|
sources = ["source.vsphere-iso.ubuntuserver"]
|
||||||
|
|
||||||
// provisioner "file" {
|
provisioner "ansible" {
|
||||||
// destination = ""
|
playbook_file = "ansible/playbook.yml"
|
||||||
// source = ""
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
post-processor "shell-local" {
|
post-processor "shell-local" {
|
||||||
inline = [
|
inline = [
|
||||||
|
Loading…
Reference in New Issue
Block a user