Newer
Older
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Install required environment
This installation has only been tested on Linux. But it should work (with small ajustements) for MacOS or Windows WSL.
There are 2 installations possibilities :
- setup tools
- docker image
## Setup tools
This installation is detailled for a Debian server. All the commands below are executed with root rights.
### Install tools
```
apt update
apt upgrade -y
apt install -y vim git make gcc python3-dev python3-pip
```
### Repository
Clone this repository on your computer:
```sh
cd /root
git clone https://git.ubicast.net/mediaserver/envsetup.git
cd envsetup/
```
### Python and ansible
To automatically create a temporary virtualenv:
```
make venv
```
If you want a permanent venv, create manually a virtual environment with [Python's venv](https://docs.python.org/3/library/venv.html) or with the package [virtualenv](https://virtualenv.pypa.io/en/stable/).
```sh
# create the venv
python3 -m venv .venv
# activate the venv
source .venv/bin/activate
# install requirements
python3 -m pip install -U pip wheel
python3 -m pip install -r requirements.txt
```
## Docker
If you do not want to bother with tools installation, you can use [Docker](https://docs.docker.com/install/).
```sh
docker run \
`# run an interactive pseudo-TTY` \
-it \
`# remove the container once you leave it` \
--rm \
`# share the current directory` \
-v $(pwd):/workspace \
`# share your SSH configuration` \
-v $HOME/.ssh:/home/code/.ssh:ro \
`# share your SSH agent` \
-v $SSH_AUTH_SOCK:/ssh-agent:ro \
`# let container know where is mapped the SSH agent` \
-e SSH_AUTH_SOCK=/ssh-agent \
`# container image to use` \
registry.ubicast.net/mediaserver/envsetup \
`# executable to run` \
bash
```
Make sur to share your SSH configuration with the Docker container, this may require to adapt the example command.
## Testing
To make sure Ansible is properly installed, run this command:
```sh
# verfiy ansible version
ansible --version
ansible 2.9.18
config file = None
configured module search path = ['/home/ubicast/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/ubicast/.local/lib/python3.7/site-packages/ansible
executable location = /home/ubicast/.local/bin/ansible
python version = 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
```