summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/config-compute
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/config-compute')
-rw-r--r--deploy/adapters/ansible/roles/config-compute/files/apt.conf3
-rw-r--r--deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml24
-rw-r--r--deploy/adapters/ansible/roles/config-compute/templates/pip.conf.j25
-rw-r--r--deploy/adapters/ansible/roles/config-compute/templates/sources.list.offline1
4 files changed, 33 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/config-compute/files/apt.conf b/deploy/adapters/ansible/roles/config-compute/files/apt.conf
new file mode 100644
index 00000000..afe7ab9e
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-compute/files/apt.conf
@@ -0,0 +1,3 @@
+APT::Get::Assume-Yes "true";
+APT::Get::force-yes "true";
+APT::Get::AllowUnauthenticated "true";
diff --git a/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml
index 6e6cae85..c36a7c2e 100644
--- a/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml
+++ b/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml
@@ -16,6 +16,18 @@
- meta: flush_handlers
+- name: create pip conf directory
+ file:
+ path: "~/.pip/"
+ state: directory
+ when: offline_deployment is defined and offline_deployment == "Enable"
+
+- name: add pip conf
+ template:
+ src: pip.conf.j2
+ dest: "~/.pip/pip.conf"
+ when: offline_deployment is defined and offline_deployment == "Enable"
+
- name: check apt source
shell: "ping -c 2 {{ LOCAL_REPOSITORY_IP }} > /dev/null"
register: checkresult
@@ -33,6 +45,18 @@
dest: /etc/apt/sources.list
when: checkresult.rc != 0
+- name: change sources list(apt)
+ template:
+ src: sources.list.offline
+ dest: /etc/apt/sources.list
+ when: offline_deployment is defined and offline_deployment == "Enable"
+
+- name: add apt.conf
+ copy:
+ src: apt.conf
+ dest: /etc/apt/apt.conf
+ when: offline_deployment is defined and offline_deployment == "Enable"
+
- name: Install apt packages
apt:
pkg: "nfs-kernel-server"
diff --git a/deploy/adapters/ansible/roles/config-compute/templates/pip.conf.j2 b/deploy/adapters/ansible/roles/config-compute/templates/pip.conf.j2
new file mode 100644
index 00000000..1ada4763
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-compute/templates/pip.conf.j2
@@ -0,0 +1,5 @@
+[global]
+find-links = http://{{ offline_repo_ip }}:{{ offline_repo_port }}/pip_pkg
+no-index = true
+[install]
+trusted-host = {{ offline_repo_ip }}
diff --git a/deploy/adapters/ansible/roles/config-compute/templates/sources.list.offline b/deploy/adapters/ansible/roles/config-compute/templates/sources.list.offline
new file mode 100644
index 00000000..15aa736f
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-compute/templates/sources.list.offline
@@ -0,0 +1 @@
+deb [arch=amd64] http://{{ offline_repo_ip }}:{{ offline_repo_port }}/xenial-ocata-ppa xenial main