Browse Source

Add upstream NGINX and EPEL for selected packages only.

With the removal of EPEL, we are selectively adding packages that
we need.  This patch adds EPEL repositories only for lsyncd to
avoid conflicts and the NGINX upstream repositories for the web
server.

Change-Id: I832ae27570c5f35d01728a9e387fc451447b38ce
Mohammed Naser 10 months ago
parent
commit
695503aa24
3 changed files with 43 additions and 1 deletions
  1. 40
    1
      tasks/repo_install.yml
  2. 1
    0
      tasks/repo_pre_install.yml
  3. 2
    0
      vars/redhat.yml

+ 40
- 1
tasks/repo_install.yml View File

@@ -13,6 +13,46 @@
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15 15
 
16
+- name: Install EPEL gpg keys
17
+  rpm_key:
18
+    key: "http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7"
19
+    state: present
20
+  when:
21
+    - ansible_pkg_mgr in ['yum', 'dnf']
22
+  register: _add_yum_keys
23
+  until: _add_yum_keys | success
24
+  retries: 5
25
+  delay: 2
26
+
27
+- name: Install the EPEL repository
28
+  yum_repository:
29
+    name: epel-repo_server
30
+    baseurl: "{{ (centos_epel_mirror | default ('http://download.fedoraproject.org/pub/epel')) ~ '/' ~ ansible_distribution_major_version ~ '/' ~ ansible_architecture }}"
31
+    description: 'Extra Packages for Enterprise Linux 7 - $basearch'
32
+    gpgcheck: yes
33
+    enabled: yes
34
+    state: present
35
+    includepkgs: 'apt-cacher-ng lsyncd'
36
+  when:
37
+    - ansible_pkg_mgr in ['yum', 'dnf']
38
+  register: install_epel_repo
39
+  until: install_epel_repo|success
40
+  retries: 5
41
+  delay: 2
42
+
43
+- name: Add NGINX repository
44
+  yum_repository:
45
+    name: nginx
46
+    description: 'nginx repo'
47
+    baseurl: "{{ repo_nginx_repo }}"
48
+    gpgkey: "{{ repo_nginx_gpg_key }}"
49
+  when:
50
+    - ansible_pkg_mgr in ['yum', 'dnf']
51
+  register: add_nginx_repo
52
+  until: add_nginx_repo is success
53
+  retries: 5
54
+  delay: 2
55
+
16 56
 - name: Install distro packages
17 57
   package:
18 58
     name: "{{ repo_server_distro_packages }}"
@@ -95,4 +135,3 @@
95 135
       delay: 2
96 136
       notify:
97 137
         - reload pypiserver
98
-

+ 1
- 0
tasks/repo_pre_install.yml View File

@@ -60,6 +60,7 @@
60 60
     - path: "{{ repo_service_home_folder }}/repo/os-releases/{{ openstack_release }}"
61 61
     - path: "{{ repo_service_home_folder }}/repo/pools"
62 62
     - path: "{{ repo_service_home_folder }}/repo/venvs"
63
+    - path: "/var/lib/nginx"
63 64
     - path: "/var/log/nginx"
64 65
       mode: "0775"
65 66
     - path: "/var/log/pypiserver"

+ 2
- 0
vars/redhat.yml View File

@@ -15,6 +15,8 @@
15 15
 
16 16
 systemd_utils_prefix: "/lib/systemd"
17 17
 
18
+repo_nginx_repo: http://nginx.org/packages/centos/7/$basearch/
19
+repo_nginx_gpg_key: http://nginx.org/keys/nginx_signing.key
18 20
 repo_nginx_pid: /run/nginx.pid
19 21
 
20 22
 git_daemon_path: /usr/libexec/git-core/git-daemon

Loading…
Cancel
Save