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 72 additions and 9 deletions
---
dependencies:
- role: base
- role: nginx
- when: "'celerity' in group_names"
role: celerity
- when: "'postgres' in group_names"
role: postgres
- when: "'wowza' in group_names"
role: wowza
...
......@@ -83,11 +83,11 @@
# SYNCHRONIZE
- name: sync all mediaservers
when: groups['server'] | length > 1
when: groups['mediaserver'] | length > 1
block:
- name: save config of first mediaserver
when: inventory_hostname == groups['server'][0]
when: inventory_hostname == groups['mediaserver'][0]
register: server_primary_config
loop:
- /etc/passwd
......@@ -97,8 +97,8 @@
path: "{{ item }}"
- name: deploy saved config
when: inventory_hostname != groups['server'][0]
loop: "{{ hostvars[groups['server'][0]].c.results }}"
when: inventory_hostname != groups['mediaserver'][0]
loop: "{{ hostvars[groups['mediaserver'][0]].c.results }}"
copy:
dest: "{{ item.source }}"
content: "{{ item.content | b64decode }}"
......@@ -125,4 +125,6 @@
include_role:
name: ferm
- meta: flush_handlers
...
......@@ -55,4 +55,15 @@ mv_backup:
exclude_list_name: "{{ mv_exclude_list_name }}"
exclude_list_items: "{{ mv_exclude_list_items }}"
# firewall rules
mv_firewall_enabled: true
mv_ferm_rules_filename: vault
mv_ferm_input_rules: []
mv_ferm_output_rules:
- proto:
- tcp
dport:
- 22
mv_ferm_global_settings:
...
File moved
---
dependencies:
- role: base
......@@ -101,4 +101,18 @@
masked: false
state: started
# FIREWALL
- name: firewall
when: mv_firewall_enabled
vars:
ferm_rules_filename: "{{ mv_ferm_rules_filename }}"
ferm_input_rules: "{{ mv_ferm_input_rules }}"
ferm_output_rules: "{{ mv_ferm_output_rules }}"
ferm_global_settings: "{{ mv_ferm_global_settings }}"
include_role:
name: ferm
- meta: flush_handlers
...
---
dependencies:
- role: base
...
......@@ -30,4 +30,6 @@
include_role:
name: ferm
- meta: flush_handlers
...
......@@ -6,7 +6,7 @@ import django
django.setup()
from skyreach_site.base.models import SiteSettings
from skyreach_site.base.models import SiteSettings # noqa
def main():
......@@ -15,10 +15,10 @@ def main():
args = parser.parse_args()
ss = SiteSettings.get_singleton()
ss.url = "https://{}".format(args.url)
ss.url = f"https://{args.url}"
ss.save()
path = "/home/skyreach/{}.log".format(args.url)
path = f"/home/skyreach/.{args.url}.log"
with open(path, "w") as flag:
flag.write("ok")
......
---
dependencies:
- role: base
- role: nginx
- when: "'postgres' in group_names"
role: postgres
...
......@@ -25,11 +25,11 @@
- name: configure domain name in database
become: true
become_user: skyreach
script: files/set_site_url.py {{ manager_hostname }}
environment:
PYTHONPATH: "/home/skyreach/htdocs/skyreach_site:/home/skyreach/htdocs:${PYTHONPATH}"
DJANGO_SETTINGS_MODULE: settings
args:
script:
cmd: files/set_site_url.py {{ manager_hostname }}
executable: python3
creates: /home/skyreach/.{{ manager_hostname }}.log
......@@ -90,4 +90,6 @@
include_role:
name: ferm
- meta: flush_handlers
...
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