Skip to content

Commit 9399a27

Browse files
author
tok
committed
Refactored all vars to group_vars
1 parent a61fb5c commit 9399a27

File tree

6 files changed

+53
-54
lines changed

6 files changed

+53
-54
lines changed

group_vars/app_servers.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
flask_app_name: resource_hub
2+
flask_user: flask
3+
flask_home: /opt/
4+
flask_repo: https://github.com/tonykay/resource_hub.git
5+
flask_scm_ref: main
6+
flask_app_lauch_script: /usr/local/bin/launch_resource_hub
7+
virtualenv_name: "venv-{{ flask_app_name }}"
8+
virtualenv_home: /opt/virtual_envs
9+
virtualenv_python: /usr/bin/python3
10+
11+
12+
app_yum_packages:
13+
- autoconf
14+
- automake
15+
- git
16+
- gcc
17+
- libtool
18+
- python3
19+
- python3-devel
20+
- python3-pip
21+
22+
pip_dependencies:
23+
- virtualenv
24+
- pip
25+
- psycopg2-binary
26+

group_vars/database_servers.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
postgres_rhel7_repo: "https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
3+
postgres_packages:
4+
- postgresql10
5+
- postgresql10-server
6+
- postgresql10-contrib
7+
- postgresql10-libs
8+
postgres_library: python-psycopg2
9+
postgres_10_data_dir: /var/lib/pgsql/10/data
10+
postgres_10_bin_path: /usr/pgsql-10/bin
11+
postgres_service: postgresql-10.service
12+
postgres_port: 5432
13+
postgres_user: postgres
14+
postgres_users:
15+
- name: flask
16+
password: redhat
17+
database: flask_db
18+
state: present
19+
priv: ALL
20+
postgres_databases:
21+
- name: flask_db
22+
owner: flask
23+
- name: books_store
24+
owner: flask

group_vars/load_balancers.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
load_balancer_packages:
3+
- haproxy

provision_app_tier.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,6 @@
44
gather_facts: false
55
tags:
66
- application_servers
7-
vars:
8-
flask_app_name: resource_hub
9-
flask_user: flask
10-
flask_home: /opt/
11-
flask_repo: https://github.com/tonykay/resource_hub.git
12-
flask_scm_ref: main
13-
flask_app_lauch_script: /usr/local/bin/launch_resource_hub
14-
virtualenv_name: "venv-{{ flask_app_name }}"
15-
virtualenv_home: /opt/virtual_envs
16-
virtualenv_python: /usr/bin/python3
17-
18-
19-
app_yum_packages:
20-
- autoconf
21-
- automake
22-
- git
23-
- gcc
24-
- libtool
25-
- python3
26-
- python3-devel
27-
- python3-pip
28-
29-
pip_dependencies:
30-
- virtualenv
31-
- pip
32-
- psycopg2-binary
337

348
tasks:
359

provision_database_tier.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,6 @@
55
gather_facts: false
66
tags:
77
- database_servers
8-
vars:
9-
postgres_rhel7_repo: "https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
10-
postgres_packages:
11-
- postgresql10
12-
- postgresql10-server
13-
- postgresql10-contrib
14-
- postgresql10-libs
15-
postgres_library: python-psycopg2
16-
postgres_10_data_dir: /var/lib/pgsql/10/data
17-
postgres_10_bin_path: /usr/pgsql-10/bin
18-
postgres_service: postgresql-10.service
19-
postgres_port: 5432
20-
postgres_user: postgres
21-
postgres_users:
22-
- name: flask
23-
password: redhat
24-
database: flask_db
25-
state: present
26-
priv: ALL
27-
postgres_databases:
28-
- name: flask_db
29-
owner: flask
30-
- name: books_store
31-
owner: flask
328

339
tasks:
3410

provision_load_balancer_tier.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
gather_facts: false
55
become: true
66

7-
vars:
8-
load_balancer_packages:
9-
- haproxy
10-
117
tags:
128
- load_balancers
139

0 commit comments

Comments
 (0)