---
# compute-video-demo-ansible
- name: Create Compute Engine instances
  hosts: localhost
  connection: local
  gather_facts: no

  vars_files:
    - gce_vars/auth
    - gce_vars/ci_machine

  roles:
    - gce-instances
    - gce-network

- name: Deploy Docker, Jenkins and nginx services
  hosts: gce_instances
  connection: ssh
  gather_facts: true
  become: true

  vars_files:
    - gce_vars/auth
    - gce_vars/ci_machine

  vars:
    jenkins_version: "2.32.3"
    jenkins_hostname: "{{ machine_names }}-{{ project_id }}"
    jenkins_install_via: "apt"
    jenkins_config_owner: "jenkins"
    jenkins_config_group: "jenkins"
    jenkins_jobs: [
        "from-git-repository"
      ]
    jenkins_plugins:
      - git
      - log-parser
      - copyartifact
      - workflow-aggregator
      - workflow-multibranch
      - docker-workflow
      - template-project
      - google-login

  roles:
    - role: gce-dns
    - role: deploy-docker
    - role: get-ssl

    - role: jdauphant.nginx
      nginx_sites:
        jenkins:
          template: nginx-configs/ci.conf
          server_name: "{{ jenkins_hostname }}.{{ project_domain }}"

    - role: ansible-jenkins
    # - role: emmetog.jenkins

---
# compute-video-demo-ansible
- name: Create Compute Engine instances
  hosts: localhost
  connection: local
  gather_facts: no

  vars_files:
    - gce_vars/auth
    - gce_vars/ci_machine

  roles:
    - gce-instances
    - gce-network

- name: Deploy Docker, Jenkins and nginx services
  hosts: gce_instances
  connection: ssh
  gather_facts: true
  become: true

  vars_files:
    - gce_vars/auth
    - gce_vars/ci_machine

  vars:
    jenkins_version: "2.32.3"
    jenkins_hostname: "{{ machine_names }}-{{ project_id }}"
    jenkins_install_via: "apt"
    jenkins_jobs: [
        "from-git-repository"
      ]
    jenkins_plugins:
      - git
      - log-parser
      - copyartifact
      - workflow-aggregator
      - workflow-multibranch
      - docker-workflow
      - template-project
      - google-login

  roles:
    - role: gce-dns
    - role: deploy-docker
    - role: get-ssl

    - role: jdauphant.nginx
      nginx_sites:
        jenkins:
          template: nginx-configs/ci.conf
          server_name: "{{ jenkins_hostname }}.{{ project_domain }}"

    - role: ansible-jenkins
    # - role: emmetog.jenkins

Install Jenkins config files as owned by 'ubuntu' user
Install Jenkins config files as owned by 'ubuntu' user
