+.galaxy/
.tox/
cloud-env.json
*.retry
the existing baseline playbook into the local playbook to reduce duplication in
code.
+## Installing Roles from Ansible Galaxy
+
+Common-packer contains a script `ansible-galaxy.sh` which runs
+`ansible-galaxy install -r requirements.yaml` from the common-packer repo to
+install common-packer role dependencies. In the local
+ci-management/packer directory a project can provide it's own requirements.yaml
+to pull in roles before running a Packer build.
+
## Local testing of common-packer
For developers of common-packer who would like to be able to locally test from
--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+ANSIBLE_ROLES_PATH="${1:-.galaxy}"
+ANSIBLE_REQUIREMENTS_FILE="${2:-requirements.yaml}"
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+ansible-galaxy install -p "$ANSIBLE_ROLES_PATH" -r "$SCRIPT_DIR/requirements.yaml"
+
+if [ -f "$ANSIBLE_REQUIREMENTS_FILE" ]; then
+ ansible-galaxy install -p "$ANSIBLE_ROLES_PATH" -r "requirements.yaml"
+fi
become_method: sudo
pre_tasks:
- - include_role: name=system-update
+ - include_role: name=lfit.system-update
- name: Install base packages
include_tasks: '{{item}}'
become: yes
roles:
- - lf-recommended-tools
- - lf-dev-libs
- - haveged-install
- - java-install
- - puppet-install
- - python-install
- - shellcheck-install
- - sysstat-install
+ - lfit.lf-recommended-tools
+ - lfit.lf-dev-libs
+ - lfit.haveged-install
+ - lfit.java-install
+ - lfit.puppet-install
+ - lfit.python-install
+ - lfit.shellcheck-install
+ - lfit.sysstat-install
post_tasks:
- name: Update /etc/nss-switch.conf to map hostname with IP
become_method: sudo
pre_tasks:
- - include_role: name=system-update
+ - include_role: name=lfit.system-update
roles:
- - { role: docker-install, mtu: 1458 }
+ - { role: lfit.docker-install, mtu: 1458 }
post_tasks:
- name: System Reseal
--- /dev/null
+---
+- src: lfit.docker-install
+- src: lfit.haveged-install
+- src: lfit.java-install
+- src: lfit.lf-dev-libs
+- src: lfit.lf-recommended-tools
+- src: lfit.mono-install
+- src: lfit.packer-install
+- src: lfit.protobuf-install
+- src: lfit.puppet-install
+- src: lfit.python-install
+- src: lfit.shellcheck-install
+- src: lfit.sysstat-install
+- src: lfit.system-update
{
"variables": {
+ "ansible_roles_path": ".galaxy",
"base_image": null,
"distro": null,
"cloud_auth_url": null,
],
"execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
},
+ {
+ "type": "shell-local",
+ "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}}"
+ },
{
"type": "ansible",
"playbook_file": "provision/local-docker.yaml",
"ansible_env_vars": [
"ANSIBLE_NOCOWS=1",
"ANSIBLE_PIPELINING=True",
- "ANSIBLE_ROLES_PATH=../lf-ansible/roles",
+ "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
"ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
"ANSIBLE_STDOUT_CALLBACK=debug"
]