summaryrefslogtreecommitdiffstats
path: root/playbooks/manual/upgrade/fedimg.yml
blob: 3f66bcbcd2b00e17065faee3c73f39a42eca1896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- name: push packages out
  hosts: fedimg:fedimg-stg
  user: root
  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
  vars:
    testing: False
  handlers:
  - include: "{{ handlers_path }}/restart_services.yml"

  tasks:
  - name: clean all metadata {%if testing%}(with infrastructure-testing on){%endif%}
    command: yum clean all {%if testing%} --enablerepo=infrastructure-testing {%endif%}
    check_mode: no
  - name: yum update fedimg packages from main repo
    yum: name="python-fedimg" state=latest
    when: not testing
  - name: yum update fedimg packages from testing repo
    yum: name="python-fedimg" state=latest enablerepo=infrastructure-testing
    when: testing
  - name: yum update libcloud from testing repo
    yum: name="python2-libcloud" state=latest enablerepo=epel-testing
    when: not testing

- name: verify the backend and restart it
  hosts: fedimg:fedimg-stg
  user: root
  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
  handlers:
  - include: "{{ handlers_path }}/restart_services.yml"

  pre_tasks:
  - name: tell nagios to shush
    nagios: action=downtime minutes=60 service=host host={{ inventory_hostname_short }}{{ env_suffix }}
    delegate_to: noc01.phx2.fedoraproject.org
    ignore_errors: true

  roles:
  - role: fedimg
    aws_keyname: fedimg-dev
    aws_keypath: /etc/pki/fedimg/fedimg-dev
    aws_pubkeypath: /etc/pki/fedimg/fedimg-dev.pub
    when: env == 'staging'
  - role: fedimg
    aws_keyname: releng-ap-northeast-1
    aws_keypath: /etc/pki/fedimg/fedimg-prod
    aws_pubkeypath: /etc/pki/fedimg/fedimg-prod.pub
    when: env != 'staging'

  post_tasks:
  - service: name="fedmsg-hub" state=restarted
  - name: tell nagios to unshush
    nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }}
    delegate_to: noc01.phx2.fedoraproject.org
    ignore_errors: true