Projet

Général

Profil

0001-Playbook-and-documentation-for-config-multitenants-w.patch

Anonyme, 09 février 2018 11:41

Télécharger (5,9 ko)

Voir les différences:

Subject: [PATCH] Playbook and documentation for config-multitenants with
 hobo-manage fix #21695

 README.rst                                         | 28 ++++++++++++++----
 config-multitenants.yml                            | 12 ++++++++
 inventory.yml                                      |  8 ++++--
 roles/config-multitenants/tasks/main.yml           | 19 +++++++++++++
 .../templates/hobo-manage-recipe-with-wcs.j2       | 33 ++++++++++++++++++++++
 roles/config-multitenants/vars/main.yml            |  2 ++
 6 files changed, 94 insertions(+), 8 deletions(-)
 create mode 100644 config-multitenants.yml
 create mode 100644 roles/config-multitenants/tasks/main.yml
 create mode 100644 roles/config-multitenants/templates/hobo-manage-recipe-with-wcs.j2
 create mode 100644 roles/config-multitenants/vars/main.yml
README.rst
64 64
=====
65 65

  
66 66
Install publik
67
--------------
68
Remember, you need to be sudoer.
67 69

  
68 70
.. code-block:: bash
69 71

  
70
   ansible-playbook -i inventory.yml -K -e user=$(whoami) install.yml
72
    ansible-playbook -i inventory.yml -K -e user=$(whoami) install.yml
71 73

  
72 74
Install publik and skip theme compilation
75
-----------------------------------------
73 76

  
74 77
.. code-block:: bash
75 78

  
76
   ansible-playbook -i inventory.yml -K -e user=$(whoami) -e compile_theme=false install.yml
79
    ansible-playbook -i inventory.yml -K -e user=$(whoami) -e compile_theme=false install.yml
77 80

  
78 81

  
79 82
Send publik to the cemetery
83
---------------------------
80 84

  
81 85
.. code-block:: bash
82 86

  
83
   ansible-playbook -i inventory.yml -K clean.yml
87
    ansible-playbook -i inventory.yml -K clean.yml
84 88

  
85
Next
86
====
87 89

  
88
Help yourself with your DNS settings and deploy some tenant applications using cook
90
Configure a basic multi-tenants publik cluster
91
-------------------------------------------------
92

  
93
To set your DNS to handle all the domains registered in the
94
certificate {{ssl_certificate}} and in the Nginx configuration for publik :
95

  
96
* edit /etc/hosts and ensure the line 127.0.0.1 has all the sub-domains required
97

  
98
.. code-block:: bash
99

  
100
    127.0.0.1       localhost hobo-hobo.local.publik agent-combo.local.publik user-combo.local.publik wcs-wcs.local.publik authentic-authentic.local.publik
101

  
102
.. code-block:: bash
103

  
104
    ansible-playbook -i inventory.yml -K -e user=$(whoami) config-multitenants.yml
config-multitenants.yml
1
---
2
- name: configuring publik multitenants for local developement
3
  hosts: local
4
  roles:
5
    - config-multitenants
6
  vars:
7
    themes_dir: "{{venv}}/themes"
8
    venv_bin: "{{venv}}/bin"
9
    venv_conf: "{{venv}}/conf"
10
    venv_pip: "{{venv_bin}}/pip"
11
    venv_python: "{{venv_bin}}/python"
12
    venv_share: "{{venv}}/share"
inventory.yml
39 39
        nginx_host_pattern: '~^(.*)\-wcs\.local\.publik$'
40 40
        project_name: wcs
41 41
        server_port: 8032
42
        
43
      
42
    hobo_base_dev_config:
43
      authentic-authentic: "authentic-authentic.local.publik"
44
      agent-combo: "agent-combo.local.publik"
45
      user-combo: "user-combo.local.publik"
46
      hobo-hobo: "hobo-hobo.local.publik"
47
      wcs-wcs: "wcs-wcs.local.publik"
roles/config-multitenants/tasks/main.yml
1
- debug :
2
    msg: |
3
      "IF {{ hobo_base_dev_config['hobo-hobo'] }} is unreachable
4
      (or any other sub-domain in inventory.yml hobo_base_dev_config) :
5
      Refer to the README to set your DNS to handle the domains in the
6
      development Nginx configuration"
7

  
8
- name : copies a wcs skeleton archive
9
  copy:
10
    src: publik.zip
11
    dest:  "/var/lib/wcs/skeletons/{{wcs_skeleton_filename}}"
12

  
13
- name: copies a cook json template
14
  template:
15
    src: templates/hobo-manage-recipe-with-wcs.j2
16
    dest: "{{wcs_dev_template_path}}"
17

  
18
- name: Run command hobo-manage to initiate the development subdomains
19
  command: "{{venv_bin}}/hobo-manage cook {{wcs_dev_template_path}} --timeout=600"
roles/config-multitenants/templates/hobo-manage-recipe-with-wcs.j2
1
{
2
  "steps": [
3
    {"create-hobo": {
4
      "url": "https://{{hobo_base_dev_config['hobo-hobo']}}/"
5
    }},
6
    {"create-authentic": {
7
      "url": "https://{{hobo_base_dev_config['authentic-authentic']}}/",
8
      "title": "Connexion"
9
    }},
10
    {"set-idp": {
11
    }},
12
    {"create-combo": {
13
        "url": "https://{{hobo_base_dev_config['user-combo']}}/",
14
        "title": "PortailUser",
15
        "template_name": "portal-user"
16
    }},
17
    {"create-combo": {
18
        "url": "https://{{hobo_base_dev_config['agent-combo']}}/",
19
        "title": "PortailAgent",
20
        "slug": "portal-agent",
21
        "template_name": "portal-agent"
22
    }},
23
    {"create-wcs": {
24
        "url": "https://{{hobo_base_dev_config['wcs-wcs']}}/",
25
        "template_name": "publik.zip",
26
        "slug": "services",
27
        "title": "Démarches"
28
    }},
29
    {"set-theme": {
30
      "theme": "publik"
31
    }}
32
  ]
33
}
roles/config-multitenants/vars/main.yml
1
wcs_dev_template_path: /tmp/hobo-manage-recipe-with-wcs.json
2
wcs_skeleton_filename: publik.zip
0
-