Can you help fix this? I am trying to write the hostname into a file.
---
- name: Update host.
hosts: all
connection: local
# Default Value
domain: '{{ default_domain }}'
hostname: “serv1.{{ '{{' }} domain {{ '}}' }}"
tasks:
- name: Update hostname config file
block:
- lineinfile:
path: /home/test/conf.yml
state: present
regexp: 'authorization-uri:(.*)$'
line: "authorization-uri: https://{{ serv1.{{ '{{' }} domain {{ '}}' }}/key/auth/mvn/vars/lenz/svc/chk”
Domain = serv1
Hostname = app2
Output should be:
https://serv1.app/key/auth/mvn/vars/lenz/svc/chk”
Given the remote host and the file
The playbook does the job
gives
Explanation of the regular expression