Skip to content
Snippets Groups Projects
  • Mathieu Leguay's avatar
    [DLAB-4126] Upgrade deployment (PKI & Ansible scripts) · cb5c111d
    Mathieu Leguay authored
    - Upgrade functions.sh: 
    Addition of genericity on the functions allowing to handle a vault file
    - Add ERASE as input parameters on PKI's scripts in order to preverse existing items when we execute scripts (add module, clients ...)
    - Upgrade generate_stores.sh in order to populate dynamically the linked vault file
    - Upgrade packaging in order to add the archive of deployment
    - Upgrade scripts according to the PKI in order to clean/fix deployment for keystores/trustores and linked configuration
    cb5c111d
main.yml 5.88 KiB
---

- name: "Install {{ vitamui_struct.package_name }} package"
  package:
    name: "{{ vitamui_struct.package_name }}"
    state: latest
  register: result
  retries: "{{ packages_install_retries_number }}"
  until: result is succeeded
  delay: "{{ packages_install_retries_delay }}"
  tags:
    - update_package_vitamui
  notify:
    - restart service
  when: force_vitamui_version is not defined

- name: Ensure {{ service_name }} service is enabled at boot
  service:
    name: "{{ service_name }}"
    enabled: true
  notify:
    - restart service

#### Configuration ####

- name: Check that the directories exist (must be removed when the RPM plugin will be patched)
  file:
    path: "{{ vitamui_defaults.folder.root_path }}/{{ item }}/{{ vitamui_struct.vitamui_component }}"
    state: directory
    owner: "{{ vitamui_defaults.users.vitamui }}"
    group: "{{ vitamui_defaults.users.group }}"
    mode: "{{ vitamui_defaults.folder.folder_permission }}"
  with_items:
    - app
    - bin
    - conf
    - data
    - lib
    - log
    - script
    - tmp
  notify:
    - restart service

- name: Ensure that the sysconfig sub-directory exists
  file:
    path: "{{ vitamui_folder_conf }}/sysconfig"
    state: directory
    owner: "{{ vitamui_defaults.users.vitamui }}"
    group: "{{ vitamui_defaults.users.group }}"
    mode: "{{ vitamui_defaults.folder.folder_permission }}"
  notify:
    - restart service

- name: Ensure that the templates sub-directory exists
  file:
    path: "{{ vitamui_folder_conf }}/templates"
    state: directory
    owner: "{{ vitamui_defaults.users.vitamui }}"
    group: "{{ vitamui_defaults.users.group }}"
    mode: "{{ vitamui_defaults.folder.folder_permission }}"
  notify:
    - restart service

- name: Deploy common configuration files in sysconfig subdir
  template:
    src: "{{ item }}.j2"
    dest: "{{ vitamui_folder_conf }}/sysconfig/{{ item }}"
    owner: "{{ vitamui_defaults.users.vitamui }}"
    group: "{{ vitamui_defaults.users.group }}"