From 64582f507346b4888f6c2d4b19c85ff050adea2b Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 8 Jan 2025 14:04:42 +0100 Subject: [PATCH] jinja spacing --- tests/playbooks/backup-cfg.yml | 16 ++++++++-------- tests/playbooks/cli-put-file.yml | 2 +- .../golden/clab-ansible-srl-golden.cfg.json.j2 | 4 ++-- tests/playbooks/replace-full-cfg.yml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/playbooks/backup-cfg.yml b/tests/playbooks/backup-cfg.yml index a257c8a..623d452 100644 --- a/tests/playbooks/backup-cfg.yml +++ b/tests/playbooks/backup-cfg.yml @@ -8,10 +8,10 @@ tasks: - name: Delete old config files ansible.builtin.file: - path: "{{item}}" + path: "{{ item}}" state: absent with_fileglob: - - "/tmp/{{inventory_hostname}}.cfg.*" + - "/tmp/{{ inventory_hostname }}.cfg.*" - name: Get entire running config nokia.srlinux.get: @@ -22,16 +22,16 @@ - name: Save fetched config in JSON ansible.builtin.copy: - content: "{{response.result[0] | to_nice_json}}" - dest: "/tmp/{{inventory_hostname}}.cfg.json" + content: "{{ response.result[0] | to_nice_json }}" + dest: "/tmp/{{ inventory_hostname }}.cfg.json" - name: Save fetched config in YAML ansible.builtin.copy: - content: "{{response.result[0] | to_nice_yaml}}" - dest: "/tmp/{{inventory_hostname}}.cfg.yml" + content: "{{ response.result[0] | to_nice_yaml }}" + dest: "/tmp/{{ inventory_hostname }}.cfg.yml" - name: check if saved file contains "srl_nokia" ansible.builtin.shell: - cmd: "grep srl_nokia {{item}}" + cmd: "grep srl_nokia {{ item }}" with_fileglob: - - "/tmp/{{inventory_hostname}}.cfg.*" + - "/tmp/{{ inventory_hostname }}.cfg.*" diff --git a/tests/playbooks/cli-put-file.yml b/tests/playbooks/cli-put-file.yml index 26a0e52..1bfd159 100644 --- a/tests/playbooks/cli-put-file.yml +++ b/tests/playbooks/cli-put-file.yml @@ -12,7 +12,7 @@ tasks: - name: template config ansible.builtin.template: - src: "{{playbook_dir}}/golden/{{inventory_hostname}}-golden.cfg.json.j2" + src: "{{ playbook_dir }}/golden/{{ inventory_hostname }}-golden.cfg.json.j2" dest: /tmp/config.json # - name: Run "show version" CLI command with text output format # hosts: clab diff --git a/tests/playbooks/golden/clab-ansible-srl-golden.cfg.json.j2 b/tests/playbooks/golden/clab-ansible-srl-golden.cfg.json.j2 index b985ba7..d8d4e31 100644 --- a/tests/playbooks/golden/clab-ansible-srl-golden.cfg.json.j2 +++ b/tests/playbooks/golden/clab-ansible-srl-golden.cfg.json.j2 @@ -1587,12 +1587,12 @@ "srl_nokia-interfaces:interface": [ { "admin-state": "enable", - "description": "ethernet-1/1 interface on {{inventory_hostname}}", + "description": "ethernet-1/1 interface on {{ inventory_hostname }}", "name": "ethernet-1/1" }, { "admin-state": "enable", - "description": "{{inventory_hostname}} management interface", + "description": "{{ inventory_hostname }} management interface", "name": "mgmt0", "subinterface": [ { diff --git a/tests/playbooks/replace-full-cfg.yml b/tests/playbooks/replace-full-cfg.yml index 6a739e6..b3af8ff 100644 --- a/tests/playbooks/replace-full-cfg.yml +++ b/tests/playbooks/replace-full-cfg.yml @@ -10,7 +10,7 @@ nokia.srlinux.config: replace: - path: / - value: "{{lookup('ansible.builtin.template', '{{playbook_dir}}/golden/{{inventory_hostname}}-golden.cfg.json.j2') }}" + value: "{{ lookup('ansible.builtin.template', '{{ playbook_dir }}/golden/{{ inventory_hostname }}-golden.cfg.json.j2') }}" register: set_response diff: true # check_mode: true