- 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' }
推薦閱讀
- Hands-On Machine Learning with TensorFlow.js
- Mastering Elastic Stack
- 分布式多媒體計算機系統
- Ceph:Designing and Implementing Scalable Storage Systems
- MATLAB/Simulink權威指南:開發(fā)環(huán)境、程序設計、系統仿真與案例實戰(zhàn)
- Practical Big Data Analytics
- Chef:Powerful Infrastructure Automation
- Silverlight 2完美征程
- 簡明學中文版Photoshop
- 大數據:引爆新的價值點
- Hadoop Beginner's Guide
- Advanced Deep Learning with Keras
- Eclipse RCP應用系統開發(fā)方法與實戰(zhàn)
- 超好玩的Python少兒編程
- 巧學活用AutoCAD