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:
|
||||
hostname: packer-template
|
||||
username: ubuntu
|
||||
password: $6$E.3LG7StnEURoOWy$PTcyaJyS5HHFExctu5hWd.oH0LapJ9gXzUd62QfVDjza4rfrEy61NVLmlGE40R7eSBvWBkISvRabc2y0NQ/sy0
|
||||
password: $6$rounds=4096$ZKfzRoaQOtc$M.fhOsI0gbLnJcCONXz/YkPfSoefP4i2/PQgzi2xHEi2x9CUhush.3VmYKL0XVr5JhoYvnLfFwqwR/1YYEqZy/
|
||||
ssh:
|
||||
install-server: yes
|
||||
allow-pw: true
|
||||
|
@ -27,8 +27,7 @@ source "vsphere-iso" "ubuntuserver" {
|
||||
|
||||
communicator = "ssh"
|
||||
ssh_username = "ubuntu"
|
||||
ssh_password = "ubuntu"
|
||||
// ssh_password = var.ssh_password
|
||||
ssh_password = var.ssh_password
|
||||
ssh_timeout = "20m"
|
||||
ssh_handshake_attempts = "100"
|
||||
ssh_pty = true
|
||||
@ -68,10 +67,9 @@ source "vsphere-iso" "ubuntuserver" {
|
||||
build {
|
||||
sources = ["source.vsphere-iso.ubuntuserver"]
|
||||
|
||||
// provisioner "file" {
|
||||
// destination = ""
|
||||
// source = ""
|
||||
// }
|
||||
provisioner "ansible" {
|
||||
playbook_file = "ansible/playbook.yml"
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
inline = [
|
||||
|
Loading…
Reference in New Issue
Block a user