-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision-ansible.sh
36 lines (33 loc) · 1.09 KB
/
provision-ansible.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
source /vagrant/lib.sh
# make sure the package index cache is up-to-date before installing anything.
apt-get update
# install ansible.
# see https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-with-pip
apt-get install -y --no-install-recommends \
python3-pip \
python3-cryptography \
python3-openssl \
python3-yaml \
python3-docker \
pylint \
sshpass
# NB this pip install will display several "error: invalid command 'bdist_wheel'"
# messages, those can be ignored.
python3 -m pip install \
-r /vagrant/ansible-requirements.txt
ansible-galaxy collection install \
-r /vagrant/ansible-requirements.yml \
-p /usr/share/ansible/collections
install -d -m 755 /etc/ansible
install -m 644 /vagrant/ansible.cfg /etc/ansible
ansible --version
python3 -m pip list
ansible-galaxy collection list
ansible -m ping localhost
# install the ansible shell completion helpers.
if [ ! -v GITHUB_ACTIONS ]; then
install -d /etc/bash_completion.d
apt-get install -y python3-argcomplete
activate-global-python-argcomplete3
fi