Autogenerate service config
This commit is contained in:
parent
5939d434fd
commit
8b7d4207b8
2 changed files with 23 additions and 0 deletions
4
dhcp.yml
4
dhcp.yml
|
@ -4,6 +4,10 @@
|
|||
vars:
|
||||
service_repo: https://gitlab.federez.net/re2o/dhcp.git
|
||||
service_name: dhcp
|
||||
service_config:
|
||||
hostname: re2o-server.adm.auro.re
|
||||
username: service-user
|
||||
password: V28GJvhhY2OSE
|
||||
dhcp:
|
||||
authoritative: true
|
||||
roles:
|
||||
|
|
|
@ -10,6 +10,25 @@
|
|||
become: true
|
||||
become_user: "{{ service_user }}"
|
||||
|
||||
- name: Configure re2o {{ service_name }} project
|
||||
ini_file:
|
||||
path: "{{ service_homedir }}/config.ini"
|
||||
section: Re2o
|
||||
option: "{{ item.key }}"
|
||||
value: "{{ item.value }}"
|
||||
mode: 0600
|
||||
become: true
|
||||
become_user: "{{ service_user }}"
|
||||
loop: "{{ service_config|dict2items }}"
|
||||
|
||||
- name: Link config file
|
||||
file:
|
||||
src: "{{ service_homedir }}/config.ini"
|
||||
dest: "{{ service_homedir }}/{{ service_name }}/config.ini"
|
||||
owner: "{{ service_user }}"
|
||||
group: nogroup
|
||||
state: link
|
||||
|
||||
- name: Indicate in motd service location
|
||||
template:
|
||||
src: update-motd.d/05-service.j2
|
||||
|
|
Loading…
Reference in a new issue