ansibleのテンプレート作りますた
最近プロビジョニングにchefよりansibleを使うことが多くなってきて、その都度コピペもあんまりよろしくないので、ベストプラクティスにそった雛形を自動生成するスクリプトを作成しました。
環境
- serverspec (>= 2.17)
- ansible (>= 2.0.0)
- python (~> 2.7)
使い方
usage: ansible-init [-h] -p PLAYBOOK_NAME [-b BOX_NAME] [-i IP_ADDR] [-m MEMORY] [-c CPU]
オプション
optional arguments: -h, --help show this help message and exit -p PLAYBOOK_NAME, --playbook_name PLAYBOOK_NAME playbook name -b BOX_NAME, --box_name BOX_NAME vagrant box name -i IP_ADDR, --ip_addr IP_ADDR private ip address -m MEMORY, --memory MEMORY box memory -c CPU, --cpu CPU box cpu
自動生成されるファイル
. ├── Rakefile ├── Vagrantfile ├── filter_plugins ├── group_vars ├── host_vars ├── library ├── roles │ └── test │ ├── defaults │ │ └── main.yml │ ├── files │ ├── handlers │ │ └── main.yml │ ├── meta │ │ └── main.yml │ ├── tasks │ │ └── main.yml │ ├── templates │ │ └── template.conf.j2 │ └── vars │ └── main.yml ├── spec │ ├── default │ │ └── sample_spec.rb │ └── spec_helper.rb └── test-playbook.yml