We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var file 大概長這樣
nodes: - name: aaa location: somewhere pub: pri: - name: bbb location: someotherplace pub: pubpub pri: pripri - name: ccc location: someotherplace pub: pri: pripri
我想在playbook 中,先include 這個var file 然後檢查 pub/pri 的值,如果pub/pri 沒有定義,依照location不同,塞不同的字串給它 我一開始先用lineinfile ,可是我不知道怎麼指定取代pub沒有定義的位置 用regexp 的話,有可能會有兩行符合條件,例如上面的aaa.pub , ccc.pub 在regexp 裡面都是一樣的,都會被取代 那有沒有辦法可以指定取代 aaa.pub 這個欄位呢?
The text was updated successfully, but these errors were encountered:
我看了 3 遍,還是不太了解想解決什麼問題,以及上面在做什麼?
還請補上更詳細的說明。
Sorry, something went wrong.
就是,我有一個 yaml 檔案,我要怎麼在ansible 中引用這個檔案,當這裡面的某個欄位值是空的,就依照規則去更新這個空值
No branches or pull requests
var file 大概長這樣
我想在playbook 中,先include 這個var file
然後檢查 pub/pri 的值,如果pub/pri 沒有定義,依照location不同,塞不同的字串給它
我一開始先用lineinfile ,可是我不知道怎麼指定取代pub沒有定義的位置
用regexp 的話,有可能會有兩行符合條件,例如上面的aaa.pub , ccc.pub
在regexp 裡面都是一樣的,都會被取代
那有沒有辦法可以指定取代 aaa.pub 這個欄位呢?
The text was updated successfully, but these errors were encountered: