From 88bd5b4f214d7188092ae20ded4554ebe5283f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n?= Date: Thu, 30 Jul 2020 20:41:49 +0200 Subject: [PATCH] v0.2 version of this repository, moving the code from TELC private repository --- README.md | 4 ++-- group_vars/all | 1 + roles/preparation/tasks/main.yml | 13 +++++-------- roles/rc_service/tasks/main.yml | 6 +++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 26d751f..68c9639 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ In this Ansible project, there are some configuration files that must be complet * **hosts:** here, you have to include the RC server which will be configured within this Ansible project. The format of each line (PLEASE FOLLOW THIS FORMAT) should be the following: *rc_hostname ansible_host= ansible_user= ansible_ssh_pass= ansible_become_pass=* * **group_vars:** includes useful variables for the servers defined in the *hosts* file. - * **all:** applies to all servers. Nothing to change here at the beginning. Only if you want to be stopped with each Ansible role execution, set *prompt_when_finishes_tasks* to true, or false otherwise. Other variables that may require a change are *eve_db_password*, setting the password to be used for the eve user in the DB, *update_module*, which specifies if it is an update (true) or an installation from scratch (false), and *turin_installation*, setting it to true if the installation will be in Turin IWL facility. + * **all:** applies to all servers. Nothing to change here at the beginning. Only if you want to be stopped with each Ansible role execution, set *prompt_when_finishes_tasks* to true, or false otherwise. Other variables that may require a change are *eve_db_password*, setting the password to be used for the eve user in the DB, *update_module*, which specifies if it is an update (true) or an installation from scratch (false), *turin_installation*, setting it to true if the installation will be in Turin IWL facility, and *inventory_ip_address* is the IP address for the IWF Repository. ### 5. Download 5geve-rc repository from Github @@ -76,7 +76,7 @@ $ git checkout dev # if exists - if not, use master branch or whatever In case the RC is going to be installed in Turin IWL facility, you need to modify, in /tmp/rc/src/main/resources/application.properties, the following variables: * **spring.datasource.password:** set the value included in *eve_db_password* in **group_vars/all** Ansible file. -* **ansible.user:** set the value included in *ansible_user* in **hosts** Ansible file. +* **inventory.ip.address:** set the value included in *inventory_ip_address* in **group_vars/all** Ansible file. Then, build the project with Maven (so you need Maven installed in your server) diff --git a/group_vars/all b/group_vars/all index 71436a7..75e2176 100644 --- a/group_vars/all +++ b/group_vars/all @@ -5,3 +5,4 @@ prompt_when_finishes_tasks: true eve_db_password: changeme update_module: true turin_installation: false +inventory_ip_address: 127.0.0.1 diff --git a/roles/preparation/tasks/main.yml b/roles/preparation/tasks/main.yml index 58b093e..20e7e87 100644 --- a/roles/preparation/tasks/main.yml +++ b/roles/preparation/tasks/main.yml @@ -26,23 +26,20 @@ src: rc.tar.gz dest: /tmp -- name: Create $HOME/5g-eve/github directory +- name: Remove 5g-eve directory if exists file: - path: /home/{{ansible_user}}/5g-eve/github - state: directory - owner: "{{ansible_user}}" - group: "{{ansible_user}}" - mode: 0755 + path: /home/{{ansible_user}}/5g-eve + state: absent - name: Remove 5geve-rc directory if exists file: - path: /home/{{ansible_user}}/5g-eve/github/5geve-rc + path: /usr/bin/rc/5geve-rc state: absent - name: Extract 5geve-rc module unarchive: src: 5geve-rc.tar.gz - dest: /home/{{ansible_user}}/5g-eve/github + dest: /usr/bin/rc - name: Installation of required packages apt: diff --git a/roles/rc_service/tasks/main.yml b/roles/rc_service/tasks/main.yml index 7fce48f..5e99438 100644 --- a/roles/rc_service/tasks/main.yml +++ b/roles/rc_service/tasks/main.yml @@ -17,11 +17,11 @@ line: "spring.datasource.password={{eve_db_password}}" when: not turin_installation -- name: Change ansible.user parameter in application.properties file +- name: Change inventory.ip.address parameter in application.properties file lineinfile: path: /tmp/rc/src/main/resources/application.properties - regexp: '^ansible.user.*' - line: "ansible.user={{ansible_user}}" + regexp: '^inventory.ip.address.*' + line: "inventory.ip.address={{inventory_ip_address}}" when: not turin_installation - name: Build rc project