forked from DevOpsTW/AMA
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
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
用 ip 位置判斷是否要執行task #44
Comments
有改出一版可以正確執行的
不過我還是弄不懂,為什麼原來的寫法不行?這兩個task的寫法是互斥的呀,怎麼會兩個task都執行? |
自我反省一下觀念
在第一個task中,因為是用 in list 去做比對,所以很正常的一直比對到有符合的資料,然後開始進行task 我的解法就是後來貼的,單獨把ip 做成一個list ,然後比對ip 就好,這樣子就不會出現上面說的情況了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我有一個playbook ,其中有兩個 task是這樣
當user ip (ansible_default_ipv4.address) 在清單內 ( {{ iuser_list }} )時
會去加入一些文字到 /etc/environment
反之,則取消這一段文字
我想請問 第一個task 已經成立 user 的電腦ip 有在 iuser_list 清單中了,可是為什麼第二個task 它還是會執行?
執行時的log
The text was updated successfully, but these errors were encountered: