mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #6991/00bfc3e1 backport][stable-6] Add example for ECS Fargate/EFS Jenkins authentication (#7015)
Add example for ECS Fargate/EFS Jenkins authentication (#6991)
* Add example for ECS Fargate/EFS Jenkins authentication
Since ECS Fargate is serverless, one cannot access its jenkins_home other than from a machine (EC2 for example) that actually mounts and owns its EFS storage.
That way we provide user/group of a defatul local user which has the same uid/gid 1000 as the default jenkins user inside the container and also can authenticate at Jenkins URL.
I feel this is not as straightforward from the docs and someone might benefit from such an example being present
* Added an empty line
* Float value now in single quotes
* Use UID/GID instead user/group name
(cherry picked from commit 00bfc3e131
)
Co-authored-by: TeekWan <74403302+teekwan@users.noreply.github.com>
This commit is contained in:
parent
43c1d9f66c
commit
4d2873afd2
1 changed files with 25 additions and 2 deletions
|
@ -27,7 +27,7 @@ options:
|
||||||
group:
|
group:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Name of the Jenkins group on the OS.
|
- GID or name of the Jenkins group on the OS.
|
||||||
default: jenkins
|
default: jenkins
|
||||||
jenkins_home:
|
jenkins_home:
|
||||||
type: path
|
type: path
|
||||||
|
@ -47,7 +47,7 @@ options:
|
||||||
owner:
|
owner:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Name of the Jenkins user on the OS.
|
- UID or name of the Jenkins user on the OS.
|
||||||
default: jenkins
|
default: jenkins
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
|
@ -195,6 +195,29 @@ EXAMPLES = '''
|
||||||
url_password: p4ssw0rd
|
url_password: p4ssw0rd
|
||||||
url: http://localhost:8888
|
url: http://localhost:8888
|
||||||
|
|
||||||
|
#
|
||||||
|
# Example of how to authenticate with serverless deployment
|
||||||
|
#
|
||||||
|
- name: Update plugins on ECS Fargate Jenkins instance
|
||||||
|
community.general.jenkins_plugin:
|
||||||
|
# plugin name and version
|
||||||
|
name: ws-cleanup
|
||||||
|
version: '0.45'
|
||||||
|
# Jenkins home path mounted on ec2-helper VM (example)
|
||||||
|
jenkins_home: "/mnt/{{ jenkins_instance }}"
|
||||||
|
# matching the UID/GID to one in official Jenkins image
|
||||||
|
owner: 1000
|
||||||
|
group: 1000
|
||||||
|
# Jenkins instance URL and admin credentials
|
||||||
|
url: "https://{{ jenkins_instance }}.com/"
|
||||||
|
url_username: admin
|
||||||
|
url_password: p4ssw0rd
|
||||||
|
# make module work from EC2 which has local access
|
||||||
|
# to EFS mount as well as Jenkins URL
|
||||||
|
delegate_to: ec2-helper
|
||||||
|
vars:
|
||||||
|
jenkins_instance: foobar
|
||||||
|
|
||||||
#
|
#
|
||||||
# Example of a Play which handles Jenkins restarts during the state changes
|
# Example of a Play which handles Jenkins restarts during the state changes
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue