Skip to content

Commit

Permalink
TODO lines moved to Issues on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
br0ziliy committed Jun 3, 2016
1 parent 441b1dd commit c7a808f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Plugin will still work without Redis installed, but this way you will lose
asynchronous capabilities, so having Redis is still highly recommended for
production use.

Plugin is known to work on following platforms/Err backends:

- CentOS 7.2 / Telegram

Installation
------------

Expand All @@ -28,6 +32,15 @@ cd /var/lib/err/plugins/err-ansible
bin/start_worker.sh
```

Make sure the user account under which you run RQ worker is able to execute
`ansible-playbook` command, and has read access to the directories/keyfile you
supply in the plugin configuration dictionary (see below).

Running worker from a different user than you run Errbot itself might lead to an
unpredictalble results - i.e. if you run Errbot process under `chat_bot`
account, you MUST run the worker under the same `chat_bot`, otherwise things
might not work. This will be fixed [in the future](br0ziliy/err-ansible#1).

Configuration
-------------

Expand Down
19 changes: 2 additions & 17 deletions ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_configuration_template(self):
"""
Defines the configuration structure this plugin supports
"""
# TODO: get_configuration_template: allow part of configuration changed

return {'INVENTORY_DIR': u"/etc/ansible/inventory", \
'PLAYBOOK_DIR': u"/etc/ansible/playbooks", \
'ANSIBLE_SSH_KEY': u"/root/.ssh/id_rsa.pub" \
Expand All @@ -32,7 +32,7 @@ def check_configuration(self, configuration):
"""
Triggers when the configuration is checked, shortly before activation
"""
# TODO: check_configuration: check supplied plugin configuration

self.log.debug("Checking plugin configuration: {}".format(configuration))
if not configuration['INVENTORY_DIR'].endswith('/'):
configuration['INVENTORY_DIR'] = \
Expand All @@ -42,20 +42,6 @@ def check_configuration(self, configuration):
"".join([configuration['PLAYBOOK_DIR'],'/'])
super(Ansible, self).check_configuration(configuration)

def callback_message(self, message):
"""
Triggered for every received message that isn't coming from the bot itself
"""
# TODO: callback_message
pass

def callback_botmessage(self, message):
"""
Triggered for every message that comes from the bot itself
"""
# TODO: callback_botmessage
pass

@arg_botcmd('inventory', type=str, \
help="filename of the inventory file")
@arg_botcmd('playbook', type=str, \
Expand Down Expand Up @@ -85,7 +71,6 @@ def ansible_list(self, mess, objects=None):
Lists available playbooks/inventory files
"""

# TODO: ansible_list: make this recursive
playbooks = []
inventories = []
if objects is 'playbooks' or objects is 'all':
Expand Down

0 comments on commit c7a808f

Please sign in to comment.