lib/tape/ansible_runner.rb in taperole-1.4.3 vs lib/tape/ansible_runner.rb in taperole-1.5.0

- old
+ new

@@ -21,11 +21,11 @@ action :restart_nginx, proc { ansible '-t restart_nginx' }, "Restarts Nginx" action :configure_deployer_user, proc { ansible '-t deployer' }, - "Ensures the deployer user is present and configures his SSH keys" + "Ensures the deployer user is present and configures its SSH keys" action :reset_db, proc { ansible '-t db_reset -e force_db_reset=true' }, "wipes and re-seeds the DB" action :bundle, proc { ansible '-t bundle -e force_bundle=true' }, @@ -41,10 +41,13 @@ "Checks out app code, installs dependencies and restarts unicorns for "\ "both FE and BE code." action :everything, proc { valid_preconfigs ? ansible : puts("Not a Rails or JS app") }, "This does it all." + action :playbook, + proc { ansible_custom_playbook }, + "Run a custom playbook" def initialize(*args) super register_notifiers end @@ -79,9 +82,13 @@ exec_ansible("#{tapefiles_dir}/omnibox.yml", cmd_str) end def ansible_deploy(cmd_str = '') exec_ansible("#{tapefiles_dir}/deploy.yml", cmd_str) + end + + def ansible_custom_playbook(cmd_str = '') + exec_ansible("#{tapefiles_dir}/#{opts.book}", cmd_str) end def exec_ansible(playbook, args) enforce_roles_path! cmd = "ANSIBLE_CONFIG=#{local_dir}/.tape/ansible.cfg ansible-playbook -i #{inventory_file} #{playbook} #{args} #{hosts_flag} -e tape_dir=#{tape_dir}"