我有一個複雜的環境,其具有可變的Ansible模板: {{ a }} 其具有defaults/main.yml定義的值。這由文件中的變量{{ b }}覆蓋。但是,這是由group_vars文件中的其他變量{{ c }}和{{ d }}組成的。 這種遞歸繼續發生了幾層。 有沒有辦法讓Ansible解析這些變量,這樣你就可以清楚地看到這個值是什麼?
我一直在嘗試部署我的劇本,但不知道錯誤是什麼。我的劇本看起來是這樣的: - name: trying to find sb ami
ec2_ami_find:
owner: self
name: SB
register: ami_find
- name : use custom ami
ec2:
image: "{{ ami_fi
我運行的一些問題,當我執行這個劇本: - hosts: all
connection: local
tasks:
- template: src=/etc/ansible/{{group_names}}/common.j2 dest=/etc/ansible/configs/{{inventory_hostname}}.txt
name: create co
我有我的第一本劇本,它失敗了。我認爲這是一個語法錯誤,但由於我不是一個編碼器,我不知道爲什麼YAML失敗?它與間距有關嗎? 以下是我有: ---
- name: Update all packages to the latest version
become: true
apt:
update_cache: yes
upgrade: dist
-