install.yaml 3.81 KB
Newer Older
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
- hosts: localhost
  tasks:
  - name: Install LTB repository
    yum_repository:
      name: LTB-project-packages-noarch
      description: LTB project packages (noarch) YUM repo
      file: ltb-project
      baseurl: https://ltb-project.org/rpm/$releasever/noarch
      gpgcheck: yes

  - name: Install LTB GPG key
    copy:
      src: RPM-GPG-KEY-LTB-project
      dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project
      owner: root
      group: root
      mode: 0644

  - name: Import LTB GPG key
    rpm_key:
      key: /etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project
      state: present

  - name: Install EPEL
    yum:
     name: epel-release
     state: installed

  - name: Install DNF plugin core
    package:
     name: dnf-plugins-core
     state: installed

  - name: Enable PowerTools
    shell: yum config-manager --set-enabled powertools

  - name: Install Remi GPG key
    copy:
      src: RPM-GPG-KEY-remi2018
      dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el8
      owner: root
      group: root
      mode: 0644

  - name: Import Remi GPG key
    rpm_key:
      key: /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el8
      state: present

  - name: Install Remi repo
    yum:
     name: "https://rpms.remirepo.net/enterprise/remi-release-8.rpm"
     state: 'present'

  - name: Enable PHP 7.4 Remi repo
    shell: dnf -y module install php:remi-7.4
    
  - name: Install required packages
    yum:
      name:
       - nginx
       - git
       - php
       - php-Smarty
       - php-fpm
       - php-ldap
       - perl-Path-Class
       - perl-LDAP
       - perl-MIME-Base64
       - perl-Digest-SHA
       - perl-Crypt-CBC
       - perl-Bytes-Random-Secure
       - perl-Archive-Extract
       - perl-File-Copy-Recursive
       - perl-XML-Twig
      state: present

  - name: Install php-fpm configuration
    copy:
      src: php-fpm.www.conf
      dest: /etc/php-fpm.d/www.conf

  - name: Create directories
    file:
      path: "{{ item }}"
      state: directory
    with_items:
      - '/etc/fusiondirectory'
      - '/etc/ldap/schema/fusiondirectory'
      - '/usr/share/fusiondirectory'
      - '/usr/local/share/fusiondirectory'
      - '/var/cache/fusiondirectory'

  - name: Clone FD git repository
    git:
      repo: 'https://gitlab.fusiondirectory.org/fusiondirectory/fd.git'
      dest: '/usr/src/fd'
      version: '1.4-dev'

  - name: Install binaries
    copy:
      src: /usr/src/fd/contrib/bin/{{ item }}
      dest: /usr/local/bin/
      owner: root
      group: root
      mode: 0755
      remote_src: yes
    with_items:
      - fusiondirectory-insert-schema
      - fusiondirectory-setup

  - name: Install Smarty plugins
    copy:
115
116
      src: /usr/src/fd/contrib/smarty/plugins/{{ item }}
      dest: /usr/share/php/Smarty/plugins/
117
118
119
120
      owner: root
      group: root
      mode: 0644
      remote_src: yes
121
122
123
124
125
    with_items:
      - block.render.php
      - function.filePath.php
      - function.iconPath.php
      - function.msgPool.php
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143

  - name: Install source files
    copy:
      src: /usr/src/fd/{{ item }}
      dest: /usr/local/share/fusiondirectory/
      owner: root
      group: root
      mode: 0755
      remote_src: yes
      directory_mode: yes
    with_items:
      - html
      - ihtml
      - locale
      - plugins
      - setup
      - include

Clément OUDOT's avatar
Clément OUDOT committed
144
145
146
147
148
149
150
151
152
  - name: Adapt Smarty path
    replace:
      path: "{{ item }}"
      regexp: '\/usr\/share\/php\/smarty3'
      replace: '/usr/share/php/Smarty'
    with_items:
      - /usr/local/share/fusiondirectory/include/variables.inc
      - /usr/local/bin/fusiondirectory-setup

153
154
155
156
157
  - name: Check directories
    command: /usr/local/bin/fusiondirectory-setup --set-fd_home=/usr/local/share/fusiondirectory --yes --check-directories

  - name: Update cache and locales
    command: /usr/local/bin/fusiondirectory-setup --set-fd_home=/usr/local/share/fusiondirectory --yes --update-cache --update-locales --write-vars