2023-05-30 09:34:10 +00:00
|
|
|
---
|
|
|
|
- name: Create webhook group
|
|
|
|
group:
|
|
|
|
name: '{{ github_webhook_service_user }}'
|
|
|
|
gid: '{{ github_webhook_service_user_uid }}'
|
|
|
|
|
|
|
|
- name: Create webhook user
|
|
|
|
user:
|
2023-09-25 14:28:49 +00:00
|
|
|
name: '{{ github_webhook_service_user }}'
|
|
|
|
group: '{{ github_webhook_service_user }}'
|
|
|
|
groups: '{{ github_webhook_service_user_groups }}'
|
|
|
|
uid: '{{ github_webhook_service_user_uid }}'
|
2023-05-30 09:34:10 +00:00
|
|
|
create_home: true
|
|
|
|
comment: 'Airflow Webhook User'
|
|
|
|
|
|
|
|
- name: Create SSH config directory
|
|
|
|
file:
|
|
|
|
path: '{{ github_webhook_home }}/.ssh'
|
|
|
|
owner: '{{ github_webhook_service_user }}'
|
|
|
|
group: '{{ github_webhook_service_user }}'
|
|
|
|
state: 'directory'
|
|
|
|
mode: 0750
|
|
|
|
when: github_webhook_ssh_key is defined
|
|
|
|
|
2023-06-01 12:50:52 +00:00
|
|
|
# The field content need the literral block style ( `|` ) to keep the EOF at the end and ensure the validity of the key.
|
2023-05-30 09:34:10 +00:00
|
|
|
- name: Create SSH private key
|
|
|
|
copy:
|
|
|
|
dest: '{{ github_webhook_home }}/.ssh/id_rsa'
|
2023-06-01 12:50:52 +00:00
|
|
|
content: |
|
|
|
|
{{ github_webhook_ssh_key }}
|
2023-05-30 09:34:10 +00:00
|
|
|
owner: '{{ github_webhook_service_user }}'
|
|
|
|
group: '{{ github_webhook_service_user }}'
|
|
|
|
mode: 0400
|
|
|
|
when: github_webhook_ssh_key is defined
|
|
|
|
|
|
|
|
- name: Update give webhook user permission to directory
|
|
|
|
file:
|
|
|
|
path: '{{ github_webhook_dest_path }}'
|
|
|
|
owner: '{{ github_webhook_service_user }}'
|
|
|
|
group: '{{ github_webhook_service_user }}'
|