-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
49 lines (43 loc) · 1.23 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- hosts: localhost
gather_facts: false
tags: k8s
tasks:
- name: get list of users from openshift
k8s_info:
api_version: v1
kind: User
register: users
changed_when: false
- name: extract email addresses
set_fact:
email_addresses: "{{ users.resources|json_query('[].metadata.name') }}"
- name: write address to file
copy:
dest: addresses.json
content: "{{ email_addresses|to_nice_json }}"
- hosts: mailman_servers
gather_facts: false
collections:
- moc.mailman
tasks:
- mailman_list:
name: operate-first-users
owner: "{{ operate_first_owners|first }}"
notify_owner: false
config:
default_member_moderation: true
member_moderation_action: 1
generic_nonmember_action: 2
accept_these_nonmembers: "{{ operate_first_posters }}"
owner: "{{ operate_first_owners }}"
- mailman_list_members:
name: operate-first-users
notify_members: false
notify_admins: false
members: "{{ hostvars.localhost.email_addresses }}"
register: result
- tags: [listinfo]
mailman_list_info:
name: operate-first-users
register: listinfo