netbox: unify string escaping style

This commit is contained in:
Markus 2021-11-03 18:25:33 +01:00
parent 9c6d490f1c
commit 9aa91059d2

View File

@ -29,15 +29,15 @@
- name: Configure PostgreSQL database - name: Configure PostgreSQL database
postgresql_db: postgresql_db:
name: '{{ netbox_dbname }}' name: "{{ netbox_dbname }}"
become: true become: true
become_user: postgres become_user: postgres
- name: Configure PostgreSQL user - name: Configure PostgreSQL user
postgresql_user: postgresql_user:
db: '{{ netbox_dbname }}' db: "{{ netbox_dbname }}"
name: '{{ netbox_dbuser }}' name: "{{ netbox_dbuser }}"
password: '{{ netbox_dbpass }}' password: "{{ netbox_dbpass }}"
priv: ALL priv: ALL
state: present state: present
become: true become: true
@ -48,39 +48,39 @@
- name: Unpack netbox - name: Unpack netbox
unarchive: unarchive:
src: 'https://github.com/netbox-community/netbox/archive/v{{ netbox_version }}.tar.gz' src: "https://github.com/netbox-community/netbox/archive/v{{ netbox_version }}.tar.gz"
dest: /opt dest: /opt
remote_src: yes remote_src: yes
creates: '/opt/netbox-{{ netbox_version }}' creates: "/opt/netbox-{{ netbox_version }}"
register: netbox_unarchive register: netbox_unarchive
- name: Configure netbox - name: Configure netbox
template: template:
src: configuration.py.j2 src: configuration.py.j2
dest: '/opt/netbox-{{ netbox_version }}/netbox/netbox/configuration.py' dest: "/opt/netbox-{{ netbox_version }}/netbox/netbox/configuration.py"
owner: '{{ netbox_user }}' owner: "{{ netbox_user }}"
group: '{{ netbox_group }}' group: "{{ netbox_group }}"
- name: Configure gunicorn - name: Configure gunicorn
template: template:
src: gunicorn.py.j2 src: gunicorn.py.j2
dest: '/opt/netbox-{{ netbox_version }}/gunicorn.py' dest: "/opt/netbox-{{ netbox_version }}/gunicorn.py"
owner: '{{ netbox_user }}' owner: "{{ netbox_user }}"
group: '{{ netbox_group }}' group: "{{ netbox_group }}"
- name: Netbox file permissions - name: Netbox file permissions
file: file:
path: '/opt/netbox-{{ netbox_version }}' path: "/opt/netbox-{{ netbox_version }}"
owner: '{{ netbox_user }}' owner: "{{ netbox_user }}"
group: '{{ netbox_group }}' group: "{{ netbox_group }}"
recurse: yes recurse: yes
- name: Run upgrade script - name: Run upgrade script
command: command:
cmd: ./upgrade.sh cmd: ./upgrade.sh
chdir: '/opt/netbox-{{ netbox_version }}' chdir: "/opt/netbox-{{ netbox_version }}"
become: true become: true
become_user: '{{ netbox_user }}' become_user: "{{ netbox_user }}"
when: netbox_unarchive.changed when: netbox_unarchive.changed
# TODO - still manual work # TODO - still manual work
@ -99,9 +99,16 @@
openssl req -x509 -nodes -newkey rsa:2048 openssl req -x509 -nodes -newkey rsa:2048
-keyout /etc/nginx/ssl/{{ netbox_domain }}.key -out /etc/nginx/ssl/{{ netbox_domain }}.crt -keyout /etc/nginx/ssl/{{ netbox_domain }}.key -out /etc/nginx/ssl/{{ netbox_domain }}.crt
-days 730 -subj "/CN={{ netbox_domain }}" -days 730 -subj "/CN={{ netbox_domain }}"
creates: '/etc/nginx/ssl/{{ netbox_domain }}.crt' creates: "/etc/nginx/ssl/{{ netbox_domain }}.crt"
notify: Restart nginx notify: Restart nginx
- name: Request nsupdate key for certificate
include_role: name=acme-dnskey-generate
vars:
acme_dnskey_san_domains:
- "{{ netbox_domain }}"
when: "'kitchen' in group_names"
- name: Configure certificate manager for netbox - name: Configure certificate manager for netbox
template: src=certs.j2 dest=/etc/acertmgr/{{ netbox_domain }}.conf template: src=certs.j2 dest=/etc/acertmgr/{{ netbox_domain }}.conf
notify: Run acertmgr notify: Run acertmgr
@ -111,7 +118,7 @@
src: vhost.j2 src: vhost.j2
dest: /etc/nginx/sites-available/netbox dest: /etc/nginx/sites-available/netbox
owner: root owner: root
mode: '0644' mode: "0644"
notify: Restart nginx notify: Restart nginx
- name: Enable vhost - name: Enable vhost