From f0ca54ac5c4408284105fe877d81e8afbfbc2991 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Fri, 13 Jan 2017 15:47:50 -0500 Subject: Making providers common (#126) * Making providers common * moving directory locations * using links and removal of vars file callout * rename of file * went block crazy * cleanup * add to remove * missing Pyyaml package in README * let docker actually setup docker storage and start the service * name change * Fix for vmware. Will variablize in the future * catchup to test common providers against master * should only be schedulable nodes --- roles/docker-storage-setup/files/docker-storage-setup | 4 ++++ roles/docker-storage-setup/tasks/main.yaml | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 roles/docker-storage-setup/files/docker-storage-setup create mode 100644 roles/docker-storage-setup/tasks/main.yaml (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/files/docker-storage-setup b/roles/docker-storage-setup/files/docker-storage-setup new file mode 100644 index 000000000..5e9d494a1 --- /dev/null +++ b/roles/docker-storage-setup/files/docker-storage-setup @@ -0,0 +1,4 @@ +DEVS=/dev/sdb +VG=docker-vol +DATA_SIZE=95%VG +EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize=3G" diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml new file mode 100644 index 000000000..32f79fff9 --- /dev/null +++ b/roles/docker-storage-setup/tasks/main.yaml @@ -0,0 +1,8 @@ +--- +- name: create the docker-storage-setup config file + copy: + src: docker-storage-setup + dest: /etc/sysconfig/docker-storage-setup + owner: root + group: root + mode: 0644 -- cgit v1.2.3 From 986d04922446da75879ce5a9064bd0db1477ac7f Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Thu, 26 Jan 2017 17:37:06 -0500 Subject: update for yamllint errors --- roles/docker-storage-setup/tasks/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml index 32f79fff9..17b13f27f 100644 --- a/roles/docker-storage-setup/tasks/main.yaml +++ b/roles/docker-storage-setup/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: create the docker-storage-setup config file copy: - src: docker-storage-setup - dest: /etc/sysconfig/docker-storage-setup - owner: root - group: root - mode: 0644 + src: docker-storage-setup + dest: /etc/sysconfig/docker-storage-setup + owner: root + group: root + mode: 0644 -- cgit v1.2.3 From 215807f53977bc561b3791e37136f140383605ef Mon Sep 17 00:00:00 2001 From: Eduardo Minguez Perez Date: Tue, 16 May 2017 16:21:10 +0200 Subject: Removed hardcoded values from ansible roles --- roles/docker-storage-setup/defaults/main.yaml | 5 +++++ roles/docker-storage-setup/files/docker-storage-setup | 4 ---- roles/docker-storage-setup/tasks/main.yaml | 4 ++-- roles/docker-storage-setup/templates/docker-storage-setup.j2 | 4 ++++ 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 roles/docker-storage-setup/defaults/main.yaml delete mode 100644 roles/docker-storage-setup/files/docker-storage-setup create mode 100644 roles/docker-storage-setup/templates/docker-storage-setup.j2 (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/defaults/main.yaml b/roles/docker-storage-setup/defaults/main.yaml new file mode 100644 index 000000000..e36f1b85a --- /dev/null +++ b/roles/docker-storage-setup/defaults/main.yaml @@ -0,0 +1,5 @@ +--- +docker_dev: "/dev/sdb" +docker_vg: "docker-vol" +docker_data_size: "95%VG" +docker_dm_basesize: "3G" diff --git a/roles/docker-storage-setup/files/docker-storage-setup b/roles/docker-storage-setup/files/docker-storage-setup deleted file mode 100644 index 5e9d494a1..000000000 --- a/roles/docker-storage-setup/files/docker-storage-setup +++ /dev/null @@ -1,4 +0,0 @@ -DEVS=/dev/sdb -VG=docker-vol -DATA_SIZE=95%VG -EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize=3G" diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml index 17b13f27f..7202bc46b 100644 --- a/roles/docker-storage-setup/tasks/main.yaml +++ b/roles/docker-storage-setup/tasks/main.yaml @@ -1,7 +1,7 @@ --- - name: create the docker-storage-setup config file - copy: - src: docker-storage-setup + template: + src: "{{ role_path }}/templates/docker-storage-setup.j2" dest: /etc/sysconfig/docker-storage-setup owner: root group: root diff --git a/roles/docker-storage-setup/templates/docker-storage-setup.j2 b/roles/docker-storage-setup/templates/docker-storage-setup.j2 new file mode 100644 index 000000000..a5203d7e4 --- /dev/null +++ b/roles/docker-storage-setup/templates/docker-storage-setup.j2 @@ -0,0 +1,4 @@ +DEVS="{{ docker_devs }}" +VG="{{ docker_vg }}" +DATA_SIZE="{{ docker_data_size }}" +EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize={{ docker_dm_basesize }}" -- cgit v1.2.3 From c9305e842efb4098477e249d2bea87a73a989f0c Mon Sep 17 00:00:00 2001 From: Peter Schiffer Date: Thu, 18 May 2017 19:14:11 +0200 Subject: More ansible migration and deploy OCP from local workstation (#376) * Create registry bucket with deployment manager * Migrate ssh proxy to Ansible * Update gce dynamic inventory script, use instance name for ssh * Fix variable name in docker storage setup role * Deploy OCP from local workstation, and not from the bastion host --- roles/docker-storage-setup/templates/docker-storage-setup.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/templates/docker-storage-setup.j2 b/roles/docker-storage-setup/templates/docker-storage-setup.j2 index a5203d7e4..b5869feff 100644 --- a/roles/docker-storage-setup/templates/docker-storage-setup.j2 +++ b/roles/docker-storage-setup/templates/docker-storage-setup.j2 @@ -1,4 +1,4 @@ -DEVS="{{ docker_devs }}" +DEVS="{{ docker_dev }}" VG="{{ docker_vg }}" DATA_SIZE="{{ docker_data_size }}" EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize={{ docker_dm_basesize }}" -- cgit v1.2.3 From c969394a52c311f1ff5cc2fc669276bc8e2b4e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20M=C3=ADnguez?= Date: Wed, 4 Oct 2017 03:31:56 +0200 Subject: Required variables to create dedicated lv (#766) * Required variables to create dedicated lv https://bugzilla.redhat.com/show_bug.cgi?id=1490910#c11 * Fixed lint and added distribution to checks --- roles/docker-storage-setup/defaults/main.yaml | 2 ++ roles/docker-storage-setup/tasks/main.yaml | 35 +++++++++++++++++----- .../templates/docker-storage-setup-dm.j2 | 4 +++ .../templates/docker-storage-setup-overlayfs.j2 | 6 ++++ .../templates/docker-storage-setup.j2 | 4 --- 5 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 roles/docker-storage-setup/templates/docker-storage-setup-dm.j2 create mode 100644 roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 delete mode 100644 roles/docker-storage-setup/templates/docker-storage-setup.j2 (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/defaults/main.yaml b/roles/docker-storage-setup/defaults/main.yaml index e36f1b85a..062f543ad 100644 --- a/roles/docker-storage-setup/defaults/main.yaml +++ b/roles/docker-storage-setup/defaults/main.yaml @@ -3,3 +3,5 @@ docker_dev: "/dev/sdb" docker_vg: "docker-vol" docker_data_size: "95%VG" docker_dm_basesize: "3G" +container_root_lv_name: "dockerlv" +container_root_lv_mount_path: "/var/lib/docker" diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml index 7202bc46b..209062ca7 100644 --- a/roles/docker-storage-setup/tasks/main.yaml +++ b/roles/docker-storage-setup/tasks/main.yaml @@ -1,8 +1,29 @@ --- -- name: create the docker-storage-setup config file - template: - src: "{{ role_path }}/templates/docker-storage-setup.j2" - dest: /etc/sysconfig/docker-storage-setup - owner: root - group: root - mode: 0644 +- block: + - name: create the docker-storage config file + template: + src: "{{ role_path }}/templates/docker-storage-setup-overlayfs.j2" + dest: /etc/sysconfig/docker-storage-setup + owner: root + group: root + mode: 0644 + + when: + - ansible_distribution_version | version_compare('7.4', '>=') + - ansible_distribution == "RedHat" + +- block: + - name: create the docker-storage-setup config file + template: + src: "{{ role_path }}/templates/docker-storage-setup-dm.j2" + dest: /etc/sysconfig/docker-storage-setup + owner: root + group: root + mode: 0644 + + when: + - ansible_distribution_version | version_compare('7.4', '<') + - ansible_distribution == "RedHat" + +- name: start docker + service: name=docker state=started enabled=true diff --git a/roles/docker-storage-setup/templates/docker-storage-setup-dm.j2 b/roles/docker-storage-setup/templates/docker-storage-setup-dm.j2 new file mode 100644 index 000000000..b5869feff --- /dev/null +++ b/roles/docker-storage-setup/templates/docker-storage-setup-dm.j2 @@ -0,0 +1,4 @@ +DEVS="{{ docker_dev }}" +VG="{{ docker_vg }}" +DATA_SIZE="{{ docker_data_size }}" +EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize={{ docker_dm_basesize }}" diff --git a/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 b/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 new file mode 100644 index 000000000..4bef865c8 --- /dev/null +++ b/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 @@ -0,0 +1,6 @@ +DEVS="{{ docker_dev }}" +VG="{{ docker_vg }}" +DATA_SIZE="{{ docker_data_size }}" +STORAGE_DRIVER=overlay2 +CONTAINER_ROOT_LV_NAME="{{ container_root_lv_name }}" +CONTAINER_ROOT_LV_MOUNT_PATH="{{ container_root_lv_mount_path }}" diff --git a/roles/docker-storage-setup/templates/docker-storage-setup.j2 b/roles/docker-storage-setup/templates/docker-storage-setup.j2 deleted file mode 100644 index b5869feff..000000000 --- a/roles/docker-storage-setup/templates/docker-storage-setup.j2 +++ /dev/null @@ -1,4 +0,0 @@ -DEVS="{{ docker_dev }}" -VG="{{ docker_vg }}" -DATA_SIZE="{{ docker_data_size }}" -EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize={{ docker_dm_basesize }}" -- cgit v1.2.3 From 5a6c1927828d942ebe4c71861521c0dae6545011 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Mon, 9 Oct 2017 09:57:08 +0000 Subject: Add CentOS support to the docker-storage-setup role This let's us use the role on CentOS systems, as well as RHEL. In addition, it installs docker and makes sure it's restarted (as opposed to just "started" which has no effect when docker is already running). --- roles/docker-storage-setup/tasks/main.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml index 209062ca7..8dabb1cc7 100644 --- a/roles/docker-storage-setup/tasks/main.yaml +++ b/roles/docker-storage-setup/tasks/main.yaml @@ -25,5 +25,21 @@ - ansible_distribution_version | version_compare('7.4', '<') - ansible_distribution == "RedHat" +- block: + - name: create the docker-storage-setup config file for CentOS + template: + src: "{{ role_path }}/templates/docker-storage-setup-dm.j2" + dest: /etc/sysconfig/docker-storage-setup + owner: root + group: root + mode: 0644 + + # TODO(shadower): Find out which CentOS version supports overlayfs2 + when: + - ansible_distribution == "CentOS" + +- name: Install Docker + package: name=docker state=present + - name: start docker - service: name=docker state=started enabled=true + service: name=docker state=restarted enabled=true -- cgit v1.2.3 From af9f352d64fba76fcaed7de4e2b35b44ddf10e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20M=C3=ADnguez?= Date: Tue, 10 Oct 2017 20:02:50 +0200 Subject: Fix for this issue https://bugzilla.redhat.com/show_bug.cgi?id=1495372 (#793) --- roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 | 1 + 1 file changed, 1 insertion(+) (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 b/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 index 4bef865c8..d8b4a0276 100644 --- a/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 +++ b/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 @@ -4,3 +4,4 @@ DATA_SIZE="{{ docker_data_size }}" STORAGE_DRIVER=overlay2 CONTAINER_ROOT_LV_NAME="{{ container_root_lv_name }}" CONTAINER_ROOT_LV_MOUNT_PATH="{{ container_root_lv_mount_path }}" +CONTAINER_ROOT_LV_SIZE=100%FREE -- cgit v1.2.3 From 8d14089a84119d4b824bfea991099941122a2c12 Mon Sep 17 00:00:00 2001 From: Chandler Wilkerson Date: Tue, 17 Oct 2017 07:53:18 -0500 Subject: Docker storage fix (#812) * Added task to stop docker before templating config * Rearranged storage roles in rhv install --- roles/docker-storage-setup/tasks/main.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'roles/docker-storage-setup') diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml index 209062ca7..dbff85662 100644 --- a/roles/docker-storage-setup/tasks/main.yaml +++ b/roles/docker-storage-setup/tasks/main.yaml @@ -1,4 +1,7 @@ --- +- name: stop docker + service: name=docker state=stopped + - block: - name: create the docker-storage config file template: @@ -7,7 +10,6 @@ owner: root group: root mode: 0644 - when: - ansible_distribution_version | version_compare('7.4', '>=') - ansible_distribution == "RedHat" @@ -20,7 +22,6 @@ owner: root group: root mode: 0644 - when: - ansible_distribution_version | version_compare('7.4', '<') - ansible_distribution == "RedHat" -- cgit v1.2.3