Packer.io: add juno packages, fix for ansible cfg and logging

This commit is contained in:
Przemyslaw Kaminski 2015-08-31 16:03:41 +02:00
parent e7fc69669d
commit 083be2d91a
4 changed files with 32 additions and 0 deletions

2
bootstrap/ansible.cfg Normal file
View File

@ -0,0 +1,2 @@
[defaults]
host_key_checking = False

View File

@ -9,3 +9,4 @@
- include: tasks/docker.yml
#- include: celery.yml tags=['master'] celery_dir=/var/run/celery
- include: tasks/cinder.yml
- include: tasks/cloud_archive.yml

View File

@ -0,0 +1,5 @@
---
- shell: add-apt-repository -y cloud-archive:juno
- shell: apt-get update || apt-get update --fix-missing

View File

@ -1,4 +1,9 @@
{
"variables": {
"ansible_config_path": "/etc/ansible",
"ansible_config_file": "ansible.cfg",
"ansible_log_file": "/tmp/ansible.log"
},
"builders": [{
"type": "virtualbox-ovf",
"source_path": "trusty64/box.ovf",
@ -7,6 +12,25 @@
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now"
}],
"provisioners": [
{
"type": "shell",
"inline": ["sudo mkdir -p {{ user `ansible_config_path` }}"]
},
{
"type": "file",
"source": "ansible.cfg",
"destination": "/tmp/ansible.cfg"
},
{
"type": "shell",
"inline": ["sudo mv /tmp/ansible.cfg {{ user `ansible_config_path` }}/{{ user `ansible_config_file` }}"]
},
{
"type": "shell",
"inline": [
"sudo echo 'log_path = {{ user `ansible_log_file` }}' >> {{ user `ansible_config_path` }}/{{ user `ansible_config_file` }}"
]
},
{
"type": "shell",
"script": "playbooks/files/ubuntu-ansible.sh"