Reputation: 2987
I am trying the pull model with Ansible, in particular I need to checkout ansible playbooks from SVN. I tried
ansible-pull -d “<destination directory ie. /home/me/playbooks>” -U “http://myversioncontrol.com/myrepo” -m subversion
But I get the error:
ERROR! Unsuported repo module subversion, choices are git
Yes, with the spelling error (Unsuported).
If I execute the command ansible-doc -l
I can see subversion in the list of the modules.
I also installed python-subversion (apt-get install python-subversion) and checked that is correctly installed.
However, I still have that error, how can I make ansible-pull to work with svn?
Upvotes: 2
Views: 1784
Reputation: 585
I got it to work. I needed to edit the installed pull.py file here (Centos 7):
/usr/lib/python2.7/site-packages/ansible/cli/pull.py
I added subversion like this:
SUPPORTED_REPO_MODULES = ['git', 'subversion']
The command line I ran was like this:
ansible-pull -m subversion -U http://subversion.company.com/test/ansible/trunk/playbook --full local.yml -i hosts
Without --full I get an error saying:
E155000: '/home/user/.ansible/pull/computername' already exists
Without -i hosts it gives an error:
sudo: a password is required
Seemingly because it is using an implicit localhost
https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html
My hosts file has an entry:
[pull]
localhost connection=paramiko ansible_user=ansible
If you don't specify local.yml it will match the hostname, which will then expect computername.yml to exist. Which may be fine.
Upvotes: 0
Reputation: 68289
-m
parameter for ansible-pull
is not a standard ansible module (that you get by ansible-doc -l
).
It is an internal wrapper around standard module inside ansible-pull
cli utility.
As per time of writing this answer, git
is the only supported pull-module (and the default one).
Here is the definition: SUPPORTED_REPO_MODULES = ['git']
Upvotes: 3