Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Sep 15, 2019
1 parent a5bc900 commit 3a500d8
Showing 1 changed file with 8 additions and 69 deletions.
77 changes: 8 additions & 69 deletions menu/roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@
- check.stat.exists == True
- switch == "on"

- name: Check /opt/docker folder exists
stat:
path: /opt/docker
register: docker_opt

- name: Create /opt/docker folder
file:
path: /opt/docker
state: directory
mode: 0775
when:
- docker_opt.stat.exists == False
- switch == "on"
tags: docker_standard

#########update part
- name: Update APT package cache
apt: update_cache=yes cache_valid_time=600
Expand Down Expand Up @@ -208,59 +193,12 @@
tags: docker_standard
when: switch == "on"

- name: Check override folder exists
stat:
path: /etc/systemd/system/docker.service.d
register: docker_root

# - name: Create docker.root.conf folder
# file:
# path: /etc/systemd/system/docker.service.d
# state: directory
# mode: 0775
# when:
# - docker_root.stat.exists == False
# - switch == "on"
# tags: docker_standard

# - name: Import docker.root.conf file
# copy:
# src: docker.root.conf
# dest: /etc/systemd/system/docker.service.d/docker.root.conf
# force: yes
# mode: 0775
# tags: docker_standard
# when: switch == "on"

# - name: Rsync docker files to new path
# shell: rsync -a /var/lib/docker/* /opt/docker

# - name: rSync docker-root dir to new path it prints FAILED when it fails
# command: rsync -v /var/lib/docker/* /opt/docker
# register: command_result
# ignore_errors: True

# - name: fail the play if the previous command did not succeed
# fail:
# msg: |

# rsync fails please try again

# when: "'FAILED' in command_result.stderr"

# - name: "docker-root dir to new path it prints FAILED when it fails"
# synchronize:
# src: /var/lib/docker/
# dest: /opt/docker
# recursive: yes

# - name: 'Wait for 20 seconds before commencing'
# wait_for:
# timeout: 20
# when: switch == "on"

# - name: Reload daemon for docker override.conf and docker.root.conf
# shell: systemctl daemon-reload && systemctl restart docker
#need check too
- name: systemctl deamon-reload
systemd:
daemon_reload: yes
notify:
- systemd daemon-reload

- name: create plexguide network
docker_network:
Expand All @@ -276,6 +214,7 @@
- switch == "on"
- check.stat.exists == True


- name: Check if docker is running and works
command: systemctl status "{{ item }}"
with_items:
Expand All @@ -291,4 +230,4 @@
Output of `systemctl status docker`:
{{ service_docker_status.stdout }}
{{ service_docker_status.stderr }}
when: service_docker_status | failed
when: service_docker_status | failed

0 comments on commit 3a500d8

Please sign in to comment.