"or" and "non" in ansible
We often need to operate a number of groups in the day-to-day work, this time we need to know some common methods of merging collections, the most important way is:::&:! "Directly below the example
Cat hosts
[Lab]
Lab1.503error.com
Lab2.503error.com
[web]
Web1.503error.com
Web2.503error.com
[Data]
Data1.503error.com
Data2.503error.com
[SSSS]
Web1.503error.com
Web2.503error.com
Data1.503error.com
Specify a group:
$ ansible Lab-i hosts--list-hosts
Lab1.503error.com
Lab2.503error.com
Specify two groups: that is, two groups can be
$ ansible Lab:data-i hosts--list-hosts
Lab1.503error.com
Lab2.503error.com
Data1.503error.com
Data2.503error.com
Specify two groups: the first group must exist and a second group exists
Ansible ' Ssss:&data '-I. hosts--list-hosts
Data1.503error.com
Specify two groups: in the first group, but not in the second group
$ Ansible ' Ssss:!data '-I. hosts--list-hosts
Web1.503error.com
Web2.503error.com