Replace json.j2 template with copy and content

This commit is contained in:
Tobias Reisinger 2025-06-11 21:29:59 +02:00
parent 4cc94969f5
commit cb10a962e3
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
6 changed files with 9 additions and 14 deletions
playbooks

View file

@ -3,9 +3,7 @@
hosts: localhost
tasks:
- name: Create the services json file
ansible.builtin.template:
src: "json.j2"
ansible.builtin.copy:
dest: "{{ services_json_file }}"
content: "{{ all_services | services_to_dnscontrol | to_json }}"
mode: "0644"
vars:
json: "{{ all_services | services_to_dnscontrol() }}"

View file

@ -6,7 +6,6 @@
vars:
svc: "{{ factorio_svc }}"
env: "{{ factorio_env }}"
json: "{{ factorio_json }}"
compose: "{{ factorio_compose }}"
block:
- name: Import prepare tasks for common service
@ -23,10 +22,10 @@
owner: "{{ factorio_uid }}"
group: "{{ factorio_gid }}"
become: true
- name: Template the server settings
ansible.builtin.template:
src: "json.j2"
- name: Create the server settings
ansible.builtin.copy:
dest: "{{ (config_path, 'server-settings.json') | path_join }}"
content: '{{ factorio_json | to_json }}'
mode: "0644"
owner: "{{ factorio_uid }}"
group: "{{ factorio_gid }}"

View file

@ -12,7 +12,7 @@
- name: Create config
ansible.builtin.copy:
dest: "{{ (service_path, 'config.yml') | path_join }}"
dest: "{{ (service_path, 'config.yaml') | path_join }}"
content: '{{ gatus_yml | to_nice_yaml }}'
mode: "0644"
notify: Restart service {{ role_name }}

View file

@ -7,10 +7,10 @@
path: "{{ config_path }}"
state: directory
mode: "0755"
- name: Copy the acme-dns-accounts
ansible.builtin.template:
src: "json.j2"
- name: Create the acme-dns-accounts
ansible.builtin.copy:
dest: "{{ (config_path, 'acme-dns-accounts.json') | path_join }}"
content: '{{ vault_acmedns_registered | acmedns_to_lego | to_json }}'
mode: "0644"
- name: Copy the hook script
ansible.builtin.copy:

View file

@ -5,7 +5,6 @@
- name: Deploy {{ role_name }}
vars:
env: "{{ lego_env }}"
json: "{{ vault_acmedns_registered | acmedns_to_lego }}"
compose: "{{ lego_compose }}"
block:
- name: Import prepare tasks for common service

View file

@ -1 +0,0 @@
{{ json | to_json }}