Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: ansible-playbook #1

Open
wojtas911 opened this issue Dec 8, 2015 · 4 comments
Open

feature request: ansible-playbook #1

wojtas911 opened this issue Dec 8, 2015 · 4 comments

Comments

@wojtas911
Copy link

Hi,
Is there any possibility to make an hubot command like
ansible-playbook, to run ansible playbooks?

@vspiewak
Copy link
Owner

vspiewak commented Dec 8, 2015

It can be a nice feature, I already throught about it.
But how to plug it ?
Run playbooks in a specific directory on the Hubot host ?

@wojtas911
Copy link
Author

Hi vspiewak
Yes, that is quite good idea, since 'The Best Ansible Practise' is to get ale ansible playbooks in one directory and just add a roles from role directory, for more You can add playbooks that hubot will run in one place.
But from the other hand the is possibility to use a playbook as script adding
#!/usr/bin/env ansible-playbook
and use a shell hubot plugin?

Or maybe:
https://serversforhackers.com/running-ansible-programmatically

Sorry but I'm not developer ;/

I'm my head is just simple idea like:
hubot run playbook add_system2_backup (or smt like that).
hubot could add an additional vars like user from hipchat,slack to record who run this task
and change var ansible_managed (http://docs.ansible.com/ansible/intro_configuration.html#ansible-managed).
like
/etc/ssh/sshd_confing

managed by wojtas911 via hubot $DATE

That could be the best, because in hubot.auth plug-in You can get a list of users-names.
When some one will mess up, it's easy to blame :P

And in some cases (example: adding smt to subversion,git) ask for some comment or other thing.
wojtas911: @hubot run palybook push_2_git
hubot: @wojtas911 add a comment (<- here it will wait 30s)
wojtas911: @hubot comment "adding new servers/files"

wojtas911: @hubot run palybook stop_ec2_instance i-123456
hubot: @wojtas911 powering off i-123456 ; Are You sure? (Yes/No)
wojtas911: @hubot yes

Sorry for long message ;(
Cheers

@jedi132000
Copy link

Hi Vincent. How about a demo on configuring the script and taking it for a spin. Like what wojtas911 suggested

@vspiewak
Copy link
Owner

Dear @wojtas911 & @jedi132000,
sorry for the laaate reply...

This hubot script has been design firstly to use dynamic inventory on EC2.
It was not design to run playbooks but bash commands with Ansible.

I updated the README.md to help you setup this script.

I'm writing a fully automated demo here (among with other things...) :
https://github.com/vspiewak/devoxxfr-2016-gocd

Best Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants