xref: /aosp_15_r20/external/cldr/tools/scripts/ansible/cldr-apps-playbook.yml (revision 912701f9769bb47905792267661f0baf2b85bed5)
1- hosts: surveytool
2  become: yes
3  vars_files:
4    - vars/main.yml
5    - local-vars/local.yml
6  tasks:
7    - name: Create CLDR dir
8      file:
9        path: "{{ cldr_path }}"
10        state: directory
11        owner: "{{ cldr_openliberty_user }}"
12        group: "{{ cldr_openliberty_group }}"
13        mode: 0775
14    - name: Rotate CLDR logs
15      blockinfile:
16        path: "/etc/logrotate.d/surveytool-logs"
17        owner: root
18        mode: "0644"
19        block: |
20          {{ cldr_path }}/cldrmail.log {{ cldr_path }}/exception.log {
21            su {{ cldr_openliberty_user }} {{ cldr_openliberty_group }}
22            daily
23            rotate 14
24            compress
25            missingok
26            notifempty
27            dateext
28            create
29          }
30        create: true
31    - name: create st/README.md
32      template:
33        dest: "{{ cldr_st_path }}/README.md"
34        src: templates/st-readme.j2
35        force: yes # want this to reflect the latest
36        owner: "{{ cldr_openliberty_user }}"
37        group: "{{ cldr_openliberty_group }}"
38        mode: "0644"
39    - name: Create cldr.properties
40      template:
41        dest: "{{ cldr_path }}/cldr.properties"
42        src: templates/cldr-properties.j2
43        force: no
44        owner: "{{ cldr_openliberty_user }}"
45        group: "{{ cldr_openliberty_group }}"
46        mode: "0644"
47      notify: Restart OpenLiberty
48    - name: Checkout CLDR trunk
49      become: yes
50      git:
51        repo: https://github.com/unicode-org/cldr.git
52        dest: "{{ cldr_trunk_path }}"
53        force: no
54        update: no
55        version: main
56        # this is a deep clone because we will need to keep updating
57        # it with history. It does not include LFS as that
58        # is not needed for the surveytool.
59    - name: Fix CLDR trunk perms
60      file:
61        path: "{{ cldr_trunk_path }}"
62        owner: "{{ cldr_surveytool_user }}"
63  handlers:
64    - name: Restart OpenLiberty
65      service:
66        name: "{{ cldr_openliberty_service }}"
67        state: restarted
68