【菜鸟】ansible学习笔记
1.ansible 初始化目录
ansible-galaxy init project
roles/aaa/
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── README.md
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.ym
这是我不知道这个功能前写的,觉得自己好傻
---
- name: Init ansible project dir
file: path=/etc/ansible/roles/{{ project }}/{{ item }} state=directory mode=0755
with_items:
- default
- file
- tasks
- templates
- meta
- vars
- handlers
- name: Touch ansible project file
file: path=/etc/ansible/roles/{{ project }}/{{ item }}/main.yml state=touch
with_items:
- default
- file
- tasks
- templates
- meta
- vars
- handlers