main.yml 2.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
- hosts: localhost

  handlers:
    - import_tasks: handlers.yml

  pre_tasks:
    - name: Set the LED steady before upgrading !!!
      shell: echo default-on >/sys/class/leds/a20-olinuxino-lime2:green:usr/trigger
      when: ansible_architecture == 'armv7l' and ansible_lsb.id == 'Debian'
      ignore_errors: yes
      tags: ['always']

  roles:
    - role: variables

rgaudin's avatar
rgaudin committed
17
18
19
    - role: restore
      tags: move-content

20
21
22
23
24
25
    # master, setup (timezone, apt-update)
    - role: system
    
      # master, resize
    - role: resize

rgaudin's avatar
rgaudin committed
26
      # master, rename
27
    - role: nginx
rgaudin's avatar
rgaudin committed
28
29

    - role: home
30
31
32
33
34

    - role: uwsgi
      tags: master

      # master, rename, setup, reconfigure
rgaudin's avatar
rgaudin committed
35
36
37
38
    - role: dnsmasq
    - role: hostapd
    - role: iptables
    - role: network-manager
39

rgaudin's avatar
rgaudin committed
40
      # master, resize, rename
41
42
    - role: kiwix

43
44
45
    # master, rename (nginx hostname), reconfigure (password)
    - role: clock

46
47
48
49
      # master, rename
    - role: captive_portal

      # content setup (install, dependencies)
50
51
52
    - role: nomad_setup
      when: ansible_local.config.nomad|bool

53
54
55
56
57
58
    - role: wikifundi_setup
      when: ansible_local.config.wikifundi_languages | length

    - role: aflatoun_setup
      when: ansible_local.config.aflatoun_languages | length

rgaudin's avatar
rgaudin committed
59
    - role: edupi_setup
60
61
62
63
64
65
      when: ansible_local.config.edupi|bool

    - role: kalite_setup
      when: ansible_local.config.kalite_languages | length

      # move content
rgaudin's avatar
rgaudin committed
66
67
68
    - role: edupi_content
      when: ansible_local.config.edupi_has_resources|bool

69
70
71
72
73
74
75
76
77
78
79
80
    - role: packages
      when: ansible_local.config.packages | length

    - role: kalite_content
      when: ansible_local.config.kalite_languages | length

    - role: aflatoun_content
      when: ansible_local.config.aflatoun_languages | length

    - role: wikifundi_content
      when: ansible_local.config.wikifundi_languages | length

rgaudin's avatar
rgaudin committed
81
82
83
    - role: backup
      tags: reconfigure

84
85
86
87
88
89
90
91
92
    - role: services
      tags: seal

  post_tasks:
    - name: Heartbeat mode on KoomBook LED, update is over !!!
      shell: echo heartbeat >/sys/class/leds/a20-olinuxino-lime2:green:usr/trigger
      when: ansible_architecture == 'armv7l' and ansible_lsb.id == 'Debian'
      ignore_errors: yes
      tags: ['always']