-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from trento-project/add-rpm-installation
Add RPM installation
- Loading branch information
Showing
23 changed files
with
251 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
docker_network_name: trentonet | ||
force_pull_images: "false" | ||
web_container_image: ghcr.io/trento-project/trento-web:rolling | ||
web_container_name: trento_web | ||
force_recreate_web_container: "false" | ||
remove_web_container_image: "true" | ||
web_postgres_host: "host.docker.internal" | ||
wanda_container_image: ghcr.io/trento-project/trento-wanda:rolling | ||
wanda_container_name: trento_wanda | ||
force_recreate_wanda_container: "false" | ||
remove_wanda_container_image: "true" | ||
wanda_postgres_host: "host.docker.internal" | ||
rabbitmq_host: host.docker.internal | ||
prometheus_url: "http://host.docker.internal:9090" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
web_listen_port: "{{ 32767 | random(start=1024, seed=trento_server_name) }}" | ||
web_postgres_db: webdb | ||
web_postgres_event_store: event_store | ||
web_postgres_user: web | ||
wanda_listen_port: "{{ 32767 | random(start=1024, seed=trento_server_name) + 1 }}" | ||
wanda_postgres_user: wanda | ||
wanda_postgres_db: wandadb | ||
rabbitmq_username: trento | ||
rabbitmq_vhost: "trento" | ||
secret_key_base: "" | ||
access_token_secret: "" | ||
refresh_token_secret: "" | ||
web_admin_username: admin | ||
enable_api_key: "true" | ||
enable_charts: "true" | ||
enable_alerting: "false" | ||
smtp_server: "" | ||
smtp_port: "" | ||
smtp_user: "" | ||
smtp_password: "" | ||
alert_sender: "" | ||
alert_recipient: "" | ||
amqp_protocol: amqp | ||
install_method: rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
web_postgres_host: "localhost" | ||
wanda_postgres_host: "localhost" | ||
rabbitmq_host: "localhost" | ||
prometheus_url: "http://localhost:9090" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# code: language=ansible | ||
--- | ||
- name: Restart trento-web | ||
ansible.builtin.service: | ||
name: trento-web | ||
state: restarted | ||
|
||
- name: Restart trento-wanda | ||
ansible.builtin.service: | ||
name: trento-wanda | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Check installation method | ||
ansible.builtin.assert: | ||
that: | ||
- install_method is defined | ||
- install_method in ['docker', 'rpm'] | ||
fail_msg: "install_method value must be one of: docker|rpm" | ||
|
||
- name: Include Docker cleanup tasks | ||
ansible.builtin.include_tasks: docker_cleanup.yml | ||
when: install_method == 'docker' | ||
|
||
- name: Include RPM cleanup tasks | ||
ansible.builtin.include_tasks: rpm_cleanup.yml | ||
when: install_method == 'rpm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
roles/containers/tasks/cleanup.yml → roles/app/tasks/docker_cleanup.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
- name: Check installation method | ||
ansible.builtin.assert: | ||
that: | ||
- install_method is defined | ||
- install_method in ['docker', 'rpm'] | ||
fail_msg: "install_method value must be one of: docker|rpm" | ||
|
||
- name: Create secrets | ||
no_log: true | ||
ansible.builtin.set_fact: # noqa: var-naming[no-jinja] | ||
"{{ item }}": "{{ lookup('community.general.random_string', base64=True, length=64) }}" | ||
when: lookup('vars', item) == "" | ||
loop: | ||
- secret_key_base | ||
- access_token_secret | ||
- refresh_token_secret | ||
|
||
- name: Verify that alerting configuration variables are defined if alerting is enabled | ||
ansible.builtin.assert: | ||
that: | ||
- alerting_env is defined | ||
- "{{ lookup('vars', alerting_env) | length > 0 }}" | ||
- "{{ lookup('vars', alerting_env) != None }}" | ||
- "{{ lookup('vars', alerting_env) != '' }}" | ||
fail_msg: "{{ alerting_env }} needs to be set in playbook variables to enable alerting" | ||
success_msg: "{{ alerting_env }} is set in playbook variables" | ||
loop_control: | ||
loop_var: alerting_env | ||
with_items: | ||
- smtp_server | ||
- smtp_port | ||
- smtp_user | ||
- smtp_password | ||
- alert_sender | ||
- alert_recipient | ||
when: enable_alerting == 'true' | ||
|
||
- name: Include Docker installation tasks | ||
ansible.builtin.include_tasks: docker.yml | ||
when: install_method == 'docker' | ||
|
||
- name: Include RPM installation tasks | ||
ansible.builtin.include_tasks: rpm.yml | ||
when: install_method == 'rpm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# code: language=ansible | ||
--- | ||
- name: Include RPM installation vars | ||
ansible.builtin.include_vars: "../defaults/rpm.yml" | ||
|
||
- name: Install Trento RPM packages | ||
community.general.zypper: | ||
name: | ||
- trento-web | ||
- trento-wanda | ||
state: latest | ||
update_cache: true | ||
notify: | ||
- Restart trento-web | ||
- Restart trento-wanda | ||
|
||
- name: Configure trento-web config | ||
ansible.builtin.template: | ||
src: trento-web.j2 | ||
dest: /etc/trento/trento-web | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
notify: | ||
- Restart trento-web | ||
|
||
- name: Configure trento-wanda config | ||
ansible.builtin.template: | ||
src: trento-wanda.j2 | ||
dest: /etc/trento/trento-wanda | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
notify: | ||
- Restart trento-wanda | ||
|
||
- name: Start trento-web service | ||
ansible.builtin.service: | ||
name: trento-web | ||
state: started | ||
enabled: true | ||
|
||
- name: Start trento-wanda service | ||
ansible.builtin.service: | ||
name: trento-wanda | ||
state: started | ||
enabled: true |
Oops, something went wrong.