Add ansible provisioner
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-06-08 09:24:39 +02:00
parent 03b5338f59
commit d680b0dde4
4 changed files with 24 additions and 7 deletions

5
ansible/playbook.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: all
gather_facts: false
roles:
- os

View 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

View File

@ -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

View File

@ -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 = [