Comments (9)
If you install the module as a normal user, the modules
and module_utils
paths must point to your home directory.
For example, on Debian 11, you would do:
export ANSIBLE_LIBRARY="${HOME}/.local/lib/python3.8/site-packages/ansible/modules"
export ANSIBLE_MODULE_UTILS="${HOME}/.local/lib/python3.8/site-packages/ansible/module_utils"
Not sure what the distinction between ansible
and ansible/modules
is, but the latter seems to work for me.
You can also put these into your ansible.cfg. The settings are called library
and module_utils
, respectively.
from ansible-modules-hashivault.
I had success using the following command after installing hashivault via pip:
ansible-playbook --module-path=/usr/local/lib/python2.7/dist-packages/ansible/modules/hashivault -i inventory/mycluster/hosts.ini -b cluster.yml
from ansible-modules-hashivault.
The main problem is default ansible python module location.
Default path is: /usr/lib/python2.7/dist-packages/ansible
when it installed from apt.
But pip installing module to local libs: /usr/local/lib/python2.7/dist-packages/ansible
In my opinion it's huge problem and it must be resolved inside module.
By the way, we can quickly hack it this using symlinks:
ln -s /usr/local/lib/python2.7/dist-packages/ansible/modules/hashivault /usr/lib/python2.7/dist-packages/ansible/modules/hashivault
ln -s /usr/local/lib/python2.7/dist-packages/ansible/module_utils/hashivault.py /usr/lib/python2.7/dist-packages/ansible/module_utils/hashivault.py
@TerryHowe could you please confirm it will be fixed soon even I will made it for community. It's official module and I think it may be done asap.
UPD: one more option:
export ANSIBLE_LIBRARY='/usr/local/lib/python2.7/dist-packages/ansible:/usr/lib/python2.7/dist-packages/ansible'
export ANSIBLE_MODULE_UTILS='/usr/local/lib/python2.7/dist-packages/ansible/module_utils:/usr/lib/python2.7/dist-packages/ansible/module_utils'
from ansible-modules-hashivault.
Yes on Xenial:
root@sandbox:/usr/local/lib/python2.7# find / -name module_utils
/usr/local/lib/python2.7/dist-packages/ansible/module_utils
/usr/lib/python2.7/dist-packages/ansible/module_utils
from ansible-modules-hashivault.
Two possible solutions:
- Add a package to ubuntu or a ppa to install hashivault
- Perhaps there is some environment variable to determine the location of ansible for pip
from ansible-modules-hashivault.
For now, the work around is going to have to be use pip to install ansible on ubuntu
from ansible-modules-hashivault.
Otherwise, the pip installation method is quite satisfactory.
Besides, it's probably better to fix the pip package than to create a new one for apt.
Thanks for this module !
from ansible-modules-hashivault.
Related ansible/ansible#46004
from ansible-modules-hashivault.
I have the same problem under Centos 7 with ansible-playbook:
centos@bhenrion4 /home/centos/soft/ansible-modules-hashivault/functional [master] $ ./start.sh
+ set -e
+ DOCKER_NAME=testvault
+ PORT=8201
+ export VAULT_ADDR=http://127.0.0.1:8201
+ VAULT_ADDR=http://127.0.0.1:8201
++ mktemp -q /tmp/./start.sh.XXXXXX
+ TMP_CONFIG=/tmp/./start.sh.TrZYta
+ trap 'rm /tmp/./start.sh.TrZYta' EXIT
+ cat
+ chmod a+r /tmp/./start.sh.TrZYta
+ docker stop testvault
testvault
+ docker rm testvault
testvault
+ docker run --name testvault -h testvault -d --cap-add IPC_LOCK -p 127.0.0.1:8201:8201 -v /tmp/./start.sh.TrZYta:/etc/vault/config.json:ro vault server -config /etc/vault/config.json
2584dfb0ccb267259e27055a50631a59dddbb7bdbf15f421ee0e79194b103004
+ CNT=0
+ curl -sI http://127.0.0.1:8201/v1/sys/health
+ sleep 0.1
++ expr 0 + 1
+ CNT=1
+ '[' 1 -gt 20 ']'
+ curl -sI http://127.0.0.1:8201/v1/sys/health
+ sleep 0.1
++ expr 1 + 1
+ CNT=2
+ '[' 2 -gt 20 ']'
+ curl -sI http://127.0.0.1:8201/v1/sys/health
+ sleep 0.1
++ expr 2 + 1
+ CNT=3
+ '[' 3 -gt 20 ']'
+ curl -sI http://127.0.0.1:8201/v1/sys/health
+ ansible-playbook -v test_init.yml
Using /home/centos/soft/ansible-modules-hashivault/functional/ansible.cfg as config file
/home/centos/soft/ansible-modules-hashivault/functional/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
/home/centos/soft/ansible-modules-hashivault/functional/hosts did not meet script requirements, check plugin documentation if this is unexpected
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/home/centos/soft/ansible-modules-hashivault/functional/test_init.yml': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: Initialize vault
^ here
+ rm /tmp/./start.sh.TrZYta
The version was installed via yum, and is:
centos@bhenrion4 /home/centos/soft/ansible-modules-hashivault/functional [master] $ ansible-playbook --version
ansible-playbook 2.7.2
config file = /home/centos/soft/ansible-modules-hashivault/functional/ansible.cfg
configured module search path = [u'/home/centos/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
centos@bhenrion4 /home/centos/soft/ansible-modules-hashivault/functional [master] $
from ansible-modules-hashivault.
Related Issues (20)
- `hashivault_pki_role` is missing a bunch of the more recent options
- hashivault_init not work with seal type transit HOT 2
- hashivault_secret_engine should support diff and check
- Possible hvac breaking change HOT 1
- whitelist_externals is deprecated in tox
- auth_method missing return value
- auth_method missing diff support HOT 1
- Policy module is missing check and diff
- oidc_auth_method_config & oidc_auth_role missing diff mode
- hashivault_db_secret_engine_config error using vault server 1.12.x and 1.13.x HOT 9
- Re-add wrap_ttl to hashivault_approle_role_secret HOT 1
- configuring allowed_other_sans parameter in hashivault_pki_role broken HOT 2
- hashivault_secret_engine doesn't support seal wrap HOT 5
- Add coverage for 'userfilter' in hashivault_auth_ldap HOT 2
- Dependency on ansible>=5.0.0 HOT 3
- TLS authentication uses removed method
- hashivault_token_renew: call to client.renew_self_token not working anymore
- https://github.com/TerryHowe/ansible-modules-hashivault/pull/467 breaks installs that use pip based hvac HOT 1
- hashivault_k8s_auth_role does not detect changes in policies
- hashivault_identity_entity_alias didn't have custom_metada parameter HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-modules-hashivault.