Add packer builder macros to create a 'ansible.cfg' file.
This is required by packer build jobs to set ansible host
configuration. The job or image specific configuration can
be created using JCasC custom files in the ci-man repository.
Issue-ID: RELENG-4032
Change-Id: Ia9fc4d26341228ba8009de6d2ec3c46e31bfc45b
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Packer Merge job runs `packer build` to build system images in the cloud.
Packer Merge job runs `packer build` to build system images in the cloud.
+This job requires a Config File Provider file named ``ansible-cfg`` created
+on Jenkins. The file can include ansible host configuration required for the
+environment.
+
:Template Names:
- {project-name}-packer-merge-{platforms}-{templates}
- gerrit-packer-merge
:Template Names:
- {project-name}-packer-merge-{platforms}-{templates}
- gerrit-packer-merge
verify job checks superficial syntax of the template and other files. It does
not attempt to build an image, and cannot detect all possible build issues.
verify job checks superficial syntax of the template and other files. It does
not attempt to build an image, and cannot detect all possible build issues.
+This job requires a Config File Provider file named ``ansible-cfg`` created
+on Jenkins. The file can include ansible host configuration required for the
+environment.
+
:Template Names:
- {project-name}-packer-verify
- gerrit-packer-verify
:Template Names:
- {project-name}-packer-verify
- gerrit-packer-verify
creates a file named gerrit_comment.txt
To use this macro add it to the list of builders.
creates a file named gerrit_comment.txt
To use this macro add it to the list of builders.
+lf-ansible-config-file-provider
+-------------------------------
+
+Provisions files required by the ansible, namely
+"~/.ansible/ansible.cfg" in the Jenkins home directory.
lf-fetch-dependent-patches
--------------------------
lf-fetch-dependent-patches
--------------------------
builders:
- shell: !include-raw: ../shell/comment-to-gerrit.sh
builders:
- shell: !include-raw: ../shell/comment-to-gerrit.sh
+- builder:
+ name: lf-ansible-config-file-provider
+ builders:
+ - config-file-provider:
+ files:
+ - file-id: "ansible-cfg"
+ target: "$HOME/.ansible/ansible.cfg"
+
- builder:
name: lf-fetch-dependent-patches
builders:
- builder:
name: lf-fetch-dependent-patches
builders:
- builder:
name: lf-infra-packer-build
builders:
- builder:
name: lf-infra-packer-build
builders:
+ - lf-ansible-config-file-provider
- conditional-step:
condition-kind: boolean-expression
condition-expression: "{openstack}"
- conditional-step:
condition-kind: boolean-expression
condition-expression: "{openstack}"
--- /dev/null
+---
+upgrade:
+ - |
+ This change requires creation of a custom managed file (ansible.cfg)
+ on the Jenkins environment with the default line
+ "remote_src = ~/.ansible/tmp".
+features:
+ - |
+ Add packer builder macros to create a 'ansible.cfg' file.
+ This is required by packer build jobs to set ansible host
+ configuration. The job or image specific configuration can be created
+ using JCasC custom files in the ci-man repository.
+
+ Example configuration:
+ https://github.com/ansible/ansible/blob/stable-2.11/examples/ansible.cfg