Update to 2020-06-19 12:00

master
Daniel Berteaud 5 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:
- patrix_enabled | default(True)
- patrix_server is defined
- patrix_user is defined
- patrix_pass is defined
- (patrix_user is defined and patrix_pass is defined) or patrix_token is defined
- role: postfix
when: system_postfix | default(True)
- role: timers

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

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

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

@ -2,41 +2,8 @@
- include_tasks: install_{{ ansible_os_family }}.yml
- name: Check if patrixrc exists
stat: path=/root/.patrixrc
register: patrix_rc
- 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
- name: Deploy patrix config for root user
template: src=patrixrc.j2 dest=/root/.patrixrc mode='600'
tags: patrix
...

Loading…
Cancel
Save