Skip to content
Snippets Groups Projects
Commit 90be3710 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

simplify roles organization and renames

parent eba3e448
No related branches found
No related tags found
No related merge requests found
Showing
with 113 additions and 72 deletions
......@@ -7,4 +7,7 @@ exclude_paths:
- playbooks/upgrade.yml
- roles/_*/
skip_list:
- '701'
...
roles/import/files/on-upload filter=lfs diff=lfs merge=lfs -text
roles/mediaimport/files/on-upload filter=lfs diff=lfs merge=lfs -text
......@@ -12,7 +12,7 @@ inventories/*
inventories/local*/host_vars/localhost.yml
playbooks/_*
roles/_*
logs/
./logs/
log/
# packer
......
SHELL := /bin/bash
DOCKER_IMAGE_NAME := registry.ubicast.net/mediaserver/envsetup
ifdef debug
MOLECULE_FLAGS += --debug
endif
ifdef keep
MOLECULE_TEST_FLAGS += --destroy=never
endif
VENV := /tmp/pyvensetup
PIP_BIN = $(shell command -v $(VENV)/bin/pip3 || command -v pip3 || echo pip3)
PIP_COMPILE_BIN = $(shell command -v $(VENV)/bin/pip-compile || command -v pip-compile)
......@@ -15,6 +9,14 @@ ANSIBLE_LINT_BIN = $(shell command -v ansible-lint || command -v $(VENV)/bin/ans
YAMLLINT_BIN = $(shell command -v yamllint || command -v $(VENV)/bin/yamllint)
FLAKE8_BIN = $(shell command -v flake8 || command -v $(VENV)/bin/flake8)
# molecule tests flags
ifdef debug
MOLECULE_FLAGS += --debug
endif
ifdef keep
MOLECULE_TEST_FLAGS += --destroy=never
endif
.PHONY: all
## TARGET: DESCRIPTION: ARGS
all: help
......@@ -50,7 +52,7 @@ lint:
$(ANSIBLE_LINT_BIN) site.yml
.PHONY: test
## test: Run development tests on the project : debug=1, keep=1
## test: Run development tests on the project : debug=1, keep=1, SKYREACH_SYSTEM_KEY=<xxx>
test:
ifndef SKYREACH_SYSTEM_KEY
$(error SKYREACH_SYSTEM_KEY is undefined)
......
......@@ -62,16 +62,16 @@ mymediaserver
mymediaworker
mymediavault
[monitor]
[msmonitor]
mymediaserver
[postgres]
mymediaserver
[manager]
[mirismanager]
mymediaserver
[server]
[mediaserver]
mymediaserver
[wowza]
......@@ -80,10 +80,10 @@ mymediaserver
[celerity]
mymediaserver
[worker]
[mediaworker]
mymediaworker
[vault]
[mediavault]
mymediavault
```
......
......@@ -11,37 +11,37 @@ make deploy i=inventories/my-customer
### MediaWorker
```sh
make deploy i=inventories/my-customer l=worker
make deploy i=inventories/my-customer l=mediaworker
```
### Monitor
```sh
make deploy i=inventories/my-customer l=monitor
make deploy i=inventories/my-customer l=msmonitor
```
### MirisManager
```sh
make deploy i=inventories/my-customer l=manager
make deploy i=inventories/my-customer l=mirismanager
```
### MediaServer
```sh
make deploy i=inventories/my-customer l=server
make deploy i=inventories/my-customer l=mediaserver
```
### MediaImport
```sh
make deploy i=inventories/my-customer l=import
make deploy i=inventories/my-customer l=mediaimport
```
### MediaVault
```sh
make deploy i=inventories/my-customer l=vault
make deploy i=inventories/my-customer l=mediavault
```
### Celerity
......@@ -73,9 +73,9 @@ make deploy i=inventories/my-customer l=netcapture
Instead of deploying all host remotely through SSH, you can also clone the envsetup repository on the server as `root` in `~/envsetup`, then enter in the directory, configure the activation or system key and run one of those commands:
```sh
make deploy i=inventories/local-server
make deploy i=inventories/local-worker
make deploy i=inventories/local-vault
make deploy i=inventories/local-mediaserver
make deploy i=inventories/local-mediaworker
make deploy i=inventories/local-mediavault
```
## Known issues
......
......@@ -28,13 +28,13 @@ Then you need the groups that will be applied to the machine, for example for a
"type": "ansible",
[...]
"groups": [
"monitor",
"msmonitor",
"postgres",
"manager",
"mirismanager",
"wowza",
"celerity",
"server",
"import"
"mediaserver",
"mediaimport"
]
}
]
......@@ -52,7 +52,7 @@ For a worker:
"type": "ansible",
[...]
"groups": [
"worker"
"mediaworker"
]
}
]
......
......@@ -8,16 +8,16 @@ mymediaworker ansible_host=10.0.0.2
; groups list and their members
[monitor]
[msmonitor]
mymediaserver
[postgres]
mymediaserver
[manager]
[mirismanager]
mymediaserver
[server]
[mediaserver]
mymediaserver
[wowza]
......@@ -26,13 +26,13 @@ mymediaserver
[celerity]
mymediaserver
[worker]
[mediaworker]
mymediaworker
[import]
[mediaimport]
mymediaserver
[vault]
[mediavault]
[netcapture]
......
localhost ansible_connection=local
[monitor]
[msmonitor]
localhost
[postgres]
localhost
[manager]
[mirismanager]
localhost
[server]
[mediaserver]
localhost
[wowza]
......@@ -18,8 +18,10 @@ localhost
[celerity]
localhost
[worker]
[mediaworker]
localhost
[import]
[mediaimport]
localhost
; vim:ft=dosini
localhost ansible_connection=local
[monitor]
[msmonitor]
localhost
[postgres]
localhost
[manager]
[mirismanager]
localhost
[server]
[mediaserver]
localhost
[wowza]
......@@ -18,5 +18,7 @@ localhost
[celerity]
localhost
[import]
[mediaimport]
localhost
; vim:ft=dosini
localhost ansible_connection=local
[vault]
[mediavault]
localhost
; vim:ft=dosini
localhost ansible_connection=local
[worker]
[mediaworker]
localhost
; vim:ft=dosini
#!/usr/bin/env ansible-playbook
---
- name: PYTHON
hosts: all
gather_facts: false
tasks:
- name: ensure python3 is installed
register: python_install
changed_when: "'es_pyinstall' in python_install.stdout_lines"
raw: command -v python3 || echo es_pyinstall && apt update && apt install -y python3-minimal python3-apt
- name: Converge
hosts: all
pre_tasks:
- name: check running in a docker container
register: check_if_docker
stat:
path: /.dockerenv
- name: set docker flag variable
set_fact:
in_docker: "{{ check_if_docker.stat.exists | d(false) }}"
roles:
- base
- postgres
- msmonitor
- mirismanager
- wowza
- celerity
- mediaworker
- mediaserver
- mediaimport
- mediavault
- netcapture
post_tasks:
- name: deploy letsencrypt certificate
when: letsencrypt_enabled | d(false)
include_role:
name: letsencrypt
- name: configure network
when: network_apply | d(false)
include_role:
name: network
- name: configure proxy
when: proxy_apply | d(false)
include_role:
name: proxy
...
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: debian-buster-${CI_PIPELINE_ID:-default}
image: registry.ubicast.net/docker/debian-systemd:buster
......@@ -16,15 +12,15 @@ platforms:
tmpfs:
- /tmp
- /run
- /run/lock
groups:
- celerity
- manager
- monitor
- mirismanager
- msmonitor
- wowza
- postgres
- server
- worker
- import
- mediaserver
- mediaworker
- mediaimport
- netcapture
provisioner:
name: ansible
......@@ -33,22 +29,5 @@ provisioner:
ANSIBLE_LIBRARY: ../../library
ANSIBLE_ACTION_PLUGINS: ../../plugins/action
ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3
lint:
name: ansible-lint
env:
ANSIBLE_ROLES_PATH: ../../roles
ANSIBLE_LIBRARY: ../../library
ANSIBLE_ACTION_PLUGINS: ../../plugins/action
ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3
inventory:
group_vars:
all:
ansible_python_interpreter: /usr/bin/python3
playbooks:
converge: ../../site.yml
verifier:
name: testinfra
lint:
name: flake8
options:
max-line-length: 90
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment