Fix: Fix ansible steps to install NodeJS and NPM
[ci-management.git] / packer / templates / memcached.json
1 {
2   "variables": {
3     "ansible_roles_path": ".galaxy",
4     "arch": "x86_64",
5     "base_image": null,
6     "distro": null,
7     "cloud_auth_url": null,
8     "cloud_user": null,
9     "cloud_pass": null,
10     "cloud_network": null,
11     "cloud_tenant": null,
12     "cloud_user_data": null,
13     "flavor": "v3-standard-2",
14     "ssh_user": null,
15     "ssh_proxy_host": ""
16   },
17   "builders": [
18     {
19       "name": "openstack",
20       "image_name": "{{user `distro`}} - memcached - {{user `arch`}} - {{isotime \"20180101-1003\"}}",
21       "source_image_name": "{{user `base_image`}}",
22       "type": "openstack",
23       "identity_endpoint": "{{user `cloud_auth_url`}}",
24       "username": "{{user `cloud_user`}}",
25       "password": "{{user `cloud_pass`}}",
26       "tenant_name": "{{user `cloud_tenant`}}",
27       "domain_name": "Default",
28       "region": "ca-ymq-1",
29       "networks": [
30         "{{user `cloud_network`}}"
31       ],
32       "user_data_file": "{{user `cloud_user_data`}}",
33       "ssh_username": "{{user `ssh_user`}}",
34       "ssh_proxy_host": "{{user `ssh_proxy_host`}}",
35       "flavor": "{{user `flavor`}}",
36       "metadata": {
37         "ci_managed": "yes"
38       }
39     }
40   ],
41   "provisioners": [
42     {
43       "type": "shell",
44       "scripts": ["common-packer/provision/install-python.sh"],
45       "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
46     },
47     {
48       "type": "shell-local",
49       "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}}"
50     },
51     {
52       "type": "ansible",
53       "command": "./common-packer/ansible-playbook.sh",
54       "skip_version_check": true,
55       "playbook_file": "provision/memcached.yaml",
56       "ansible_env_vars": [
57         "ANSIBLE_NOCOWS=1",
58         "ANSIBLE_PIPELINING=True",
59         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
60         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
61         "ANSIBLE_STDOUT_CALLBACK=debug"
62       ]
63     }
64   ]
65 }