Ansible Tools e.g. Create directory by BestPractice
Install it yourself as:
$ gem install ansible_tools
$ ansible-tools
Commands:
ansible-tools help [COMMAND] # Describe available commands or one specific command
ansible-tools init [-s][-r][-y] # create ansible files by BestPractice
ansible-tools show # show ansible valiables in vars/main.yml
ansible-tools version # show version
$ ansible-tools init [-y]
create roles/common/tasks
create roles/common/handlers
create roles/common/templates
create roles/common/vars
create roles/common/files
create group_vars
create host_vars
create site.yml
create roles/common/tasks/main.yml
create roles/common/handlers/main.yml
create roles/common/templates/foo.conf.j2 #(*1)
create roles/common/vars/main.yml
create roles/common/files/bar.txt #(*1)
create production #(*1)
create stage #(*1)
create group_vars/group1 #(*1)
create group_vars/group2 #(*1)
create host_vars/hostname1 #(*1)
create host_vars/hostname2 #(*1)
(*1)...if set [-y], this file is not create.
$ ansible-tools init -s [-y]
create roles/common/tasks
create roles/common/handlers
create roles/common/templates
create roles/common/vars
create roles/common/files
create site.yml
create roles/common/tasks/main.yml
create roles/common/handlers/main.yml
create roles/common/templates/foo.conf.j2 #(*1)
create roles/common/vars/main.yml
create roles/common/files/bar.txt #(*1)
(*1)...if set [-y], this file is not create.
$ ansible-tools init -r <roles name> [-y]
$ ansible-tools init -r gitlab
create roles/gitlab/tasks
create roles/gitlab/handlers
create roles/gitlab/templates
create roles/gitlab/vars
create roles/gitlab/files
create site.yml
create roles/gitlab/tasks/main.yml
create roles/gitlab/handlers/main.yml
create roles/gitlab/templates/foo.conf.j2 #(*1)
create roles/gitlab/vars/main.yml
create roles/gitlab/files/bar.txt #(*1)
(*1)...if set [-y], this file is not create.
Search file and write list
file => roles/*/vars/main.yml
, group_vars/*.yml
, host_vars/*.yml
, *.yml
$ ansible-tools show
+----------------------------------------------------------------------------+
| File | Key | Value |
+----------------------------------------------------------------------------+
| host_vars/main.yml | var1 | num1 |
| group_vars/main.yml | var2 | num2 |
| roles/gitlab/vars/main.yml | mysql_gitlab_password | password |
| roles/gitlab/vars/main.yml | mysql_gitlab_database | gitlabhq_production |
| roles/mariadb/vars/main.yml | mysql_root_password | password |
| roles/Packages/vars/main.yml | www_port | 80 |
| roles/ruby/vars/main.yml | ruby_ver | 2.0.0-p247 |
+----------------------------------------------------------------------------+
show version
$ ansible-tools version
0.0.4
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
0.0.4 Add Option init [-y]
- Make Test