https://github.com/RoleModel/bash_command
Ansible role to execute arbitrary bash commands via a role
https://github.com/RoleModel/bash_command
Last synced: about 1 year ago
JSON representation
Ansible role to execute arbitrary bash commands via a role
- Host: GitHub
- URL: https://github.com/RoleModel/bash_command
- Owner: RoleModel
- License: mit
- Created: 2015-06-27T18:50:23.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-01T20:37:08.000Z (almost 11 years ago)
- Last Synced: 2025-02-24T01:14:16.543Z (over 1 year ago)
- Size: 109 KB
- Stars: 9
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```yml
- 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.
```yml
- 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