1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
TeekWan 2023-07-27 09:56:59 +02:00 committed by GitHub
parent e815040877
commit 00bfc3e131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
# #