你能帮忙解决这个问题吗?我正在尝试将主机名写入文件。
---
- 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”
给定远程主机和文件
剧本完成任务
给
正则表达式的解释