added setup for technitium admin account to playbook
This commit is contained in:
1 parent
130a59552f
commit
5e3377ba46
1 file changed
+49
@@ -214,3 +214,52 @@
|
|||||||
# Generated by Technitium DNS Server Installer
|
# Generated by Technitium DNS Server Installer
|
||||||
|
|
||||||
nameserver 127.0.0.1
|
nameserver 127.0.0.1
|
||||||
|
|
||||||
|
# Admin user setup
|
||||||
|
- name: Prompt for Technitium admin password
|
||||||
|
ansible.builtin.pause:
|
||||||
|
prompt: "Set Technitium admin password"
|
||||||
|
echo: no
|
||||||
|
register: technitium_pass_raw
|
||||||
|
|
||||||
|
- name: Prompt to confirm Technitium admin password
|
||||||
|
ansible.builtin.pause:
|
||||||
|
prompt: "Confirm Technitium admin password"
|
||||||
|
echo: no
|
||||||
|
register: technitium_pass_confirm
|
||||||
|
|
||||||
|
- name: Fail if passwords do not match
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: "Passwords do not match!"
|
||||||
|
when: technitium_pass_raw.user_input != technitium_pass_confirm.user_input
|
||||||
|
|
||||||
|
- name: Wait for Technitium web console to be available
|
||||||
|
ansible.builtin.wait_for:
|
||||||
|
host: localhost
|
||||||
|
port: 5380
|
||||||
|
timeout: 60
|
||||||
|
|
||||||
|
- name: Login with default admin credentials
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://localhost:5380/api/user/login"
|
||||||
|
method: GET
|
||||||
|
body_format: form-urlencoded
|
||||||
|
body:
|
||||||
|
user: admin
|
||||||
|
pass: admin
|
||||||
|
includeInfo: "true"
|
||||||
|
register: technitium_login
|
||||||
|
no_log: true
|
||||||
|
failed_when: technitium_login.json.status != 'ok'
|
||||||
|
|
||||||
|
- name: Change admin password
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://localhost:5380/api/user/changePassword"
|
||||||
|
method: GET
|
||||||
|
body_format: form-urlencoded
|
||||||
|
body:
|
||||||
|
token: "{{ technitium_login.json.response.token }}"
|
||||||
|
pass: "{{ technitium_pass_raw.user_input }}"
|
||||||
|
no_log: true
|
||||||
|
failed_when: technitium_change_pass.json.status != 'ok'
|
||||||
|
register: technitium_change_pass
|
||||||
Reference in new issue
Block a user