summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ansible')
-rwxr-xr-xansible/group_vars/all.yml5
-rw-r--r--ansible/infrastructure.yml22
-rw-r--r--ansible/roles/package-repository/defaults/main.yml2
-rw-r--r--ansible/roles/package-repository/tasks/main.yml19
4 files changed, 24 insertions, 24 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index cd8c7f58..8e81d7f0 100755
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -59,9 +59,8 @@ certificates:
# Default value is to allow redeploy
redeploy_k8s_env: yes
-# Distribute offline rpm repository
-# Default value is to distribute rpm
-deploy_rpm_repository: yes
+# Distribute offline software package (rpm,apt) repository
+deploy_package_repository: yes
# Offline solution is deploying app specific rpm repository and requires some name
# also for k8s cluster
diff --git a/ansible/infrastructure.yml b/ansible/infrastructure.yml
index e4715a9c..89d63e89 100644
--- a/ansible/infrastructure.yml
+++ b/ansible/infrastructure.yml
@@ -1,28 +1,8 @@
---
- name: Perform common environment setup for nodes
hosts: infrastructure, kubernetes
- tasks:
- - name: Setup resolv.conf
- lineinfile:
- line: "nameserver {{ hostvars[groups.infrastructure[0]].cluster_ip }}"
- path: /etc/resolv.conf
- state: present
- insertbefore: BOF
- become: yes
- - name: Add application offline rpm repository
- yum_repository:
- name: "{{ app_name }}"
- file: "{{ app_name | lower }}"
- description: "{{ app_name }} offline repository"
- baseurl: "{{ 'http://repo.infra-server/rhel' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}"
- gpgcheck: no
- enabled: yes
- when: deploy_rpm_repository
- become: yes
-
-- name: Setup firewall
- hosts: infrastructure, kubernetes
roles:
+ - package-repository
- role: firewall
vars:
state: disable
diff --git a/ansible/roles/package-repository/defaults/main.yml b/ansible/roles/package-repository/defaults/main.yml
new file mode 100644
index 00000000..ea5796df
--- /dev/null
+++ b/ansible/roles/package-repository/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+deploy_package_repository: true
diff --git a/ansible/roles/package-repository/tasks/main.yml b/ansible/roles/package-repository/tasks/main.yml
new file mode 100644
index 00000000..686310e4
--- /dev/null
+++ b/ansible/roles/package-repository/tasks/main.yml
@@ -0,0 +1,19 @@
+---
+- name: Setup resolv.conf for node to find package repository by name from infra
+ lineinfile:
+ line: "nameserver {{ hostvars[groups.infrastructure[0]].cluster_ip }}"
+ path: /etc/resolv.conf
+ state: present
+ insertbefore: BOF
+ become: true
+
+- name: Add application offline package repository
+ yum_repository:
+ name: "{{ app_name }}"
+ file: "{{ app_name | lower }}"
+ description: "{{ app_name | upper }} offline repository"
+ baseurl: "{{ 'http://repo.infra-server/rhel' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}"
+ gpgcheck: false
+ enabled: true
+ when: deploy_package_repository
+ become: true