initial commit
This commit is contained in:
15
tasks/32-get-admin-token.yml
Normal file
15
tasks/32-get-admin-token.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: "Get Admin Token on first installation"
|
||||
when: "ts3_initial_installation"
|
||||
block:
|
||||
- name: "get file content"
|
||||
shell: "grep '|token=' {{ ts3_base_dir }}/logs/*.log"
|
||||
register: ts3_log_content
|
||||
|
||||
- name: "search for token"
|
||||
ansible.builtin.set_fact:
|
||||
ts3_admin_token: "{{ item | regex_search('.*\\|token=(.*)$', '\\1') | first }}"
|
||||
when:
|
||||
- "'|token=' in item"
|
||||
loop: "{{ ts3_log_content.stdout_lines }}"
|
||||
Reference in New Issue
Block a user