Update to 2020-06-19 12:00

master
Daniel Berteaud 4 years ago
parent 9b370a1e35
commit 3a78eb2054
  1. 3
      roles/common/meta/main.yml
  2. 8
      roles/patrix/defaults/main.yml
  3. 2
      roles/patrix/tasks/install_Debian.yml
  4. 1
      roles/patrix/tasks/install_RedHat.yml
  5. 39
      roles/patrix/tasks/main.yml

@ -22,8 +22,7 @@ dependencies:
when: when:
- patrix_enabled | default(True) - patrix_enabled | default(True)
- patrix_server is defined - patrix_server is defined
- patrix_user is defined - (patrix_user is defined and patrix_pass is defined) or patrix_token is defined
- patrix_pass is defined
- role: postfix - role: postfix
when: system_postfix | default(True) when: system_postfix | default(True)
- role: timers - role: timers

@ -1,8 +1,16 @@
--- ---
# patrix_server: # patrix_server:
#
#
# Auth can be done either with login / pass
# patrix_user: # patrix_user:
# patrix_pass: # patrix_pass:
#
# Or with an existing token
#
# patrix_token:
#
# patrix_room: # patrix_room:
... ...

@ -12,6 +12,7 @@
- libjson-perl - libjson-perl
- libterm-readkey-perl - libterm-readkey-perl
- libhash-merge-simple-perl - libhash-merge-simple-perl
tags: patrix
- name: Install patrix - name: Install patrix
get_url: get_url:
@ -20,4 +21,5 @@
mode: 0755 mode: 0755
environment: environment:
- https_proxy: "{{ system_proxy | default('') }}" - https_proxy: "{{ system_proxy | default('') }}"
tags: patrix

@ -2,3 +2,4 @@
- name: Install patrix - name: Install patrix
yum: name=patrix yum: name=patrix
tags: patrix

@ -2,41 +2,8 @@
- include_tasks: install_{{ ansible_os_family }}.yml - include_tasks: install_{{ ansible_os_family }}.yml
- name: Check if patrixrc exists - name: Deploy patrix config for root user
stat: path=/root/.patrixrc template: src=patrixrc.j2 dest=/root/.patrixrc mode='600'
register: patrix_rc tags: patrix
- name: Create patrixrc file
copy:
dest: /root/.patrixrc
content: |
[default]
server=_server_
access_token=_access_token_
room=_room_
when: not patrix_rc.stat.exists
- name: Get an access token
command: patrix --get-access-token --server={{ patrix_server }} --user={{ patrix_user }} --password={{ patrix_pass }}
register: patrix_token
environment:
- https_proxy: "{{ system_proxy | default('') }}"
when: not patrix_rc.stat.exists
- name: Configure patrix
ini_file:
path: /root/.patrixrc
section: default
option: "{{ item.option }}"
value: "{{ item.value }}"
no_log: True
with_items:
- option: server
value: "{{ patrix_server }}"
- option: access_token
value: "{{ patrix_token.stdout }}"
- option: room
value: "{{ patrix_room }}"
when: not patrix_rc.stat.exists and patrix_token is defined
... ...

Loading…
Cancel
Save