Skip to content

Ansible role to execute arbitrary bash commands via a role

License

Notifications You must be signed in to change notification settings

RoleModel/bash_command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bash_command

Will execute the passed command in the passed dir. Useful for doing things like bundle install and rake db:migrate via a role.

- hosts: defaults
  roles:
    - { role: bash_command, dir: '/var/www/my_app', command: 'bundle install' }
    - { role: bash_command, dir: '/var/www/my_app', command: 'bundle exec rake db:migrate' }

Additionally you can specify the role to only run on a single node. Useful for things that would cause errors if run on multiple hosts.

- hosts: defaults
  roles:
    - { role: bash_command, dir: '/var/www/my_app', command: 'bundle install' }
    - { role: bash_command, dir: '/var/www/my_app', command: 'bundle exec rake db:migrate', single_node: true }

License

  • MIT

About

Ansible role to execute arbitrary bash commands via a role

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published