-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting.yaml
31 lines (29 loc) · 922 Bytes
/
testing.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- name: Setting RADIUS Database
hosts: db_host
become: no
vars:
username: crafter
u_home: /home/crafter
cur_root_pw: "ISjp76AK"
tasks:
- name: Laod Informations on databases to be created
ansible.builtin.include_vars:
file: databases.yaml
name: db_def
- name: Show databases
ansible.builtin.debug:
msg: "{{ db_def }}"
# - name: Print Ansible facts
# ansible.builtin.debug:
# var: ansible_ssh_host
- name: Create User Accounts & Set privileges
community.mysql.mysql_user:
host: '%'
name: "{{ item.username }}"
password: "{{ item.user_pw }}"
priv: '{{ item.db }}.*:SELECT/{{ item.db }}.radacct:ALL/{{ item.db }}.radpostauth:ALL'
login_user: root
login_password: "{{ cur_root_pw }}"
login_unix_socket: /var/run/mysqld/mysqld.sock
with_items: "{{ db_def.databases }}"