- Security Automation with Ansible 2
- Madhu Akula Akash Mahajan
- 67字
- 2021-07-02 21:59:52
Loops example
The following task adds users using the Jinja2 templating. This allows for dynamic functionality in playbooks. We can use variables to store data when required, we just need to update the variables rather than the entire playbook:
- name: add several users user: name: "{{ item.name }}" state: present groups: "{{ item.groups }}" with_items: - { name: 'testuser1', groups: 'wheel' } - { name: 'testuser2', groups: 'root' }
推薦閱讀
- Google Cloud Platform Cookbook
- R Data Mining
- Mastering VMware vSphere 6.5
- Visual FoxPro 6.0數(shù)據(jù)庫與程序設(shè)計(jì)
- 數(shù)控銑削(加工中心)編程與加工
- 微型計(jì)算機(jī)控制技術(shù)
- 網(wǎng)絡(luò)綜合布線技術(shù)
- Windows 7寶典
- 大數(shù)據(jù)驅(qū)動(dòng)的設(shè)備健康預(yù)測(cè)及維護(hù)決策優(yōu)化
- 悟透AutoCAD 2009完全自學(xué)手冊(cè)
- Google SketchUp for Game Design:Beginner's Guide
- MCGS嵌入版組態(tài)軟件應(yīng)用教程
- Containers in OpenStack
- Spatial Analytics with ArcGIS
- PLC與變頻技術(shù)應(yīng)用