--- - 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 ...