servers/roles/netbox/tasks/main.yml
Timotej Lazar c7a3513fa1 Add netbox role
Kinda ouroborosish if you think about it. Better don’t.
2024-05-28 12:32:28 +02:00

26 lines
575 B
YAML

- name: Set variables
set_fact:
user: '{{ user | default("netbox") }}'
database: '{{ database | default("netbox") }}'
db_password: '{{ lookup("password", "/dev/null", chars=["ascii_letters", "digits"]) }}'
- name: Create group for web service
group:
name: '{{ user }}'
system: yes
- name: Create user for web service
user:
name: '{{ user }}'
group: '{{ user }}'
home: '/srv/{{ user }}'
shell: /bin/sh
system: yes
register: user_info
- name: Set up database
import_tasks: db.yml
- name: Set up app
import_tasks: app.yml