You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
---
|
|
|
|
- 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
|
|
|
|
...
|
|
|