legacy_certificates.yml 1.22 KB
Newer Older
1 2 3
# ansible-playbook -i ec2.py --limit="tag_cluster_certificates:&tag_environment_loadtest" legacy_certificates.yml
- name: Deploy legacy_certs
  hosts: all
4
  become: True
5 6 7
  gather_facts: True
  vars:
    serial_count: 1
Feanil Patel committed
8
    repo_url: "git@github.com:edx/certificates.git"
9 10
    repo_path: "/opt/wwc/certificates"
    certificates_version: "master"
11
    git_ssh_script: "/opt/wwc/git.sh"
12 13 14 15 16
  serial: "{{ serial_count }}"
  tasks:
    - name: stop certs service
      service: name="certificates" state="stopped"
    - name: checkout code
17
      git:
18 19 20 21
        repo: "{{ repo_url }}"
        dest: "{{ repo_path }}"
        version: "{{ certificates_version }}"
        accept_hostkey: yes
22 23
      environment:
        GIT_SSH: "{{ git_ssh_script }}"
24 25 26 27 28
    - name: install requirements
      pip:
        requirements: "{{ repo_path }}/requirements.txt"
        virtualenv: "/opt/edx"
        state: present
29 30 31
    # Need to do this because the www-data user is not properly setup
    # and can't run ssh.
    - name: change owner to www-data
32 33 34 35 36 37
      file:
        path: "{{ repo_path }}"
        owner: "www-data"
        group: "www-data"
        recurse: yes
        state: "directory"
38
    - name: start certs service
39
      service: name="certificates" state="started"