AutolabJS/AutolabJS

View on GitHub
deploy/uninstall.yml

Summary

Maintainability
Test Coverage
- hosts: mysqldb
  become: yes
  tasks:
    - name: Stop and Remove Database Container
      docker_container:
        name: autolabjs-db
        state: absent
      ignore_errors: yes

- hosts: gitlab
  become: yes
  tasks:
    - name: Stop and Remove Gitlab Container
      docker_container:
        name: gitlab
        state: absent
      ignore_errors: yes

- hosts: lb
  become: yes
  tasks:
    - name: Stop and Remove Loadbalancer container
      docker_container:
        name: loadbalancer
        state: absent
      ignore_errors: yes

- hosts: ms
  become: yes
  tasks:
    - name: Stop and remove mainserver container
      docker_container:
        name: mainserver
        state: absent
      ignore_errors: yes

- hosts: executionnodes
  become: yes
  tasks:
    - name: Stop and remove execution_node container
      docker_container:
        name: "execution-node-{{ ansible_host }}-{{ en_port }}"
        state: absent
      ignore_errors: yes

- hosts: machines
  become: yes
  tasks:
    - name: Remove autolab directory completely
      file: "dest={{ install_dir }} state=absent"
      ignore_errors: yes

    - name: Remove all images
      docker_image:
        name: "{{ item }}"
        state: absent
      ignore_errors: yes
      with_items:
      - "autolabjs/gitlab-ce:10.1.4-ce.0"
      - "autolabjs/mysql:5.7.4"
      - "autolabjs/nodejs:0.5.0"
      - "autolabjs/executionnode:0.5.0"
      - "main_server"
      - "load_balancer"
      - "execution_node"

    - name: Remove firewall policies
      import_tasks: plays/tasks/ufwreset.yml

- hosts: all
  become: yes
  tasks:
    - name: Remove crontab from all the machines running AutolabJS components
      cron:
        name: "autolabjs-restart"
        cron_file: "autolabjs"
        state: absent