VOL-241 VOL-239 VOL-257 VOL-258 This update solves multiple problems
and cleans up the ansible tree somewhat.
VOL-241 Removes the error messages during dependent software installation
VOL-239 Removes the dependency on apt-get -y -f
VOL-257 Adds a config file to specify the docker containers required for
a production deployment of vOLT-HA
VOL-258 Adds error checking after the voltha VM executes the vOLT-HA
build to stop on errors rather than continuing and having the
installer fail much later when docker containers are missing.
- General cleanup of the ansible tree.
- Removal of ansible centos conditionals since they're not required.
- Removal of the check for puppet and chef, not required.
- Adds a cleanup script that will remove temporary files added
during an install so they don't get submitted to the repo by
accident.
Note there are lots of commented out lines in the ansible scripts.
These will be removed in a subsequent update.
Change-Id: I92da352408dbfed1a05d13a1e10003f169be6a66
diff --git a/install/ansible/roles/docker/tasks/centos.yml b/install/ansible/roles/docker/tasks/centos.yml
deleted file mode 100644
index a8910d4..0000000
--- a/install/ansible/roles/docker/tasks/centos.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-- name: CentOS files are copied
- copy:
- src: "{{ item.src }}"
- dest: "{{ item.dest }}"
- with_items: centos_files
- tags: [docker]
-
-- name: CentOS package is installed
- yum:
- name: docker-engine
- state: present
- tags: [docker]
-
-- name: CentOS Daemon is reloaded
- command: systemctl daemon-reload
- tags: [docker]
-
-- name: CentOS service is running
- service:
- name: docker
- state: running
- tags: [docker]
-
diff --git a/install/ansible/roles/docker/tasks/debian.yml b/install/ansible/roles/docker/tasks/debian.yml
deleted file mode 100644
index d9f3f37..0000000
--- a/install/ansible/roles/docker/tasks/debian.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-- name: Debian add Docker repository and update apt cache
- apt_repository:
- repo: deb https://apt.dockerproject.org/repo ubuntu-{{ debian_version }} main
- update_cache: yes
- state: present
- when: target == "installer"
- tags: [docker]
-
-- name: Debian Docker is present
- apt:
- name: docker-engine
- state: latest
- force: yes
- when: target == "installer"
- tags: [docker]
-
-- name: Debian python-pip is present
- apt:
- name: python-pip
- state: present
- when: target == "installer"
- tags: [docker]
-
-- name: Debian docker-py is present
- pip:
- name: docker-py
- version: "{{ docker_py_version }}"
- state: present
- when: target == "installer"
- tags: [docker]
-
-- name: netifaces pip package is present
- pip:
- name: netifaces
- version: "{{ netifaces_version }}"
- state: present
- when: target == "installer"
- tags: [docker]
-
-- name: Docker config files are present
- template:
- src: "{{ docker_cfg }}"
- dest: "{{ docker_cfg_dest }}"
- register: copy_result
- tags: [docker]
-
-- name: Debian Daemon is reloaded
- command: systemctl daemon-reload
- when: copy_result|changed and is_systemd is defined
- tags: [docker]
-
-- name: Sudo user is added to the docker group
- user:
- name: "{{ ansible_env['SUDO_USER'] }}"
- group: docker
- register: user_result
- tags: [docker]
-
-- name: Debian Docker service is restarted
- service:
- name: docker
- state: restarted
- when: copy_result|changed or user_result|changed
- tags: [docker]
diff --git a/install/ansible/roles/docker/tasks/main.yml b/install/ansible/roles/docker/tasks/main.yml
index 1495847..d9f3f37 100644
--- a/install/ansible/roles/docker/tasks/main.yml
+++ b/install/ansible/roles/docker/tasks/main.yml
@@ -1,5 +1,64 @@
-- include: debian.yml
- when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
+- name: Debian add Docker repository and update apt cache
+ apt_repository:
+ repo: deb https://apt.dockerproject.org/repo ubuntu-{{ debian_version }} main
+ update_cache: yes
+ state: present
+ when: target == "installer"
+ tags: [docker]
-- include: centos.yml
- when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
+- name: Debian Docker is present
+ apt:
+ name: docker-engine
+ state: latest
+ force: yes
+ when: target == "installer"
+ tags: [docker]
+
+- name: Debian python-pip is present
+ apt:
+ name: python-pip
+ state: present
+ when: target == "installer"
+ tags: [docker]
+
+- name: Debian docker-py is present
+ pip:
+ name: docker-py
+ version: "{{ docker_py_version }}"
+ state: present
+ when: target == "installer"
+ tags: [docker]
+
+- name: netifaces pip package is present
+ pip:
+ name: netifaces
+ version: "{{ netifaces_version }}"
+ state: present
+ when: target == "installer"
+ tags: [docker]
+
+- name: Docker config files are present
+ template:
+ src: "{{ docker_cfg }}"
+ dest: "{{ docker_cfg_dest }}"
+ register: copy_result
+ tags: [docker]
+
+- name: Debian Daemon is reloaded
+ command: systemctl daemon-reload
+ when: copy_result|changed and is_systemd is defined
+ tags: [docker]
+
+- name: Sudo user is added to the docker group
+ user:
+ name: "{{ ansible_env['SUDO_USER'] }}"
+ group: docker
+ register: user_result
+ tags: [docker]
+
+- name: Debian Docker service is restarted
+ service:
+ name: docker
+ state: restarted
+ when: copy_result|changed or user_result|changed
+ tags: [docker]
diff --git a/install/ansible/roles/docker/templates/docker.cfg b/install/ansible/roles/docker/templates/docker.cfg
index d59db12..a18aeb0 100644
--- a/install/ansible/roles/docker/templates/docker.cfg
+++ b/install/ansible/roles/docker/templates/docker.cfg
@@ -1 +1 @@
-DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 192.168.121.91:5000 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --registry-mirror=http://192.168.121.91:5001"
+DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 192.168.121.92:5000 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --registry-mirror=http://192.168.121.92:5001"