From 280ac8dbda68f5136e5769033c5e30653935f8a6 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Mon, 8 Oct 2018 14:17:54 -0400 Subject: [PATCH] Move away from yum Latest versions of CentOS and RHEL already have YUM deprecated and future versions would drop support. This commit moves browbeat to use the package module instead of yum. Package module will select DNF if it is available on the system rather than yum. Change-Id: I5892fd6209e3be7f3cb69bcfe3df54726043354a --- ansible/browbeat/install-at.yml | 2 +- ansible/check/roles/common/tasks/main.yml | 4 +++- ansible/install/roles/browbeat-results/tasks/main.yml | 2 +- ansible/install/roles/collectd-generic/tasks/main.yml | 4 ++-- ansible/install/roles/curator/tasks/main.yml | 4 +++- ansible/install/roles/elasticsearch/tasks/main.yml | 4 +++- ansible/install/roles/epel/handlers/main.yml | 2 +- ansible/install/roles/epel/tasks/main.yml | 8 ++++++-- ansible/install/roles/filebeat/tasks/main.yml | 8 ++++++-- ansible/install/roles/grafana/tasks/main.yml | 4 +++- ansible/install/roles/graphite/tasks/main.yml | 2 +- ansible/install/roles/kibana/tasks/main.yml | 8 ++++++-- ansible/install/roles/logstash/tasks/main.yml | 4 +++- ansible/install/roles/nginx/tasks/main.yml | 4 +++- ansible/install/roles/rsyslog-install/tasks/main.yml | 6 +++--- ansible/install/roles/rsyslog-templates/tasks/main.yml | 2 +- ansible/install/roles/statsd-install/tasks/main.yml | 4 +++- 17 files changed, 49 insertions(+), 23 deletions(-) diff --git a/ansible/browbeat/install-at.yml b/ansible/browbeat/install-at.yml index fa95751c5..8d3882846 100644 --- a/ansible/browbeat/install-at.yml +++ b/ansible/browbeat/install-at.yml @@ -18,7 +18,7 @@ - repo tasks: - name: Install at - yum: + package: name: at become: true diff --git a/ansible/check/roles/common/tasks/main.yml b/ansible/check/roles/common/tasks/main.yml index b8c966ae7..9e6b63719 100644 --- a/ansible/check/roles/common/tasks/main.yml +++ b/ansible/check/roles/common/tasks/main.yml @@ -9,7 +9,9 @@ ignore_errors: True - name: Install Crudini if it is not there - yum: name=crudini state=present + package: + name: crudini + state: present when: crudini.rc == 1 - name: Get selinux mode diff --git a/ansible/install/roles/browbeat-results/tasks/main.yml b/ansible/install/roles/browbeat-results/tasks/main.yml index d74799ef1..a8bb3bbc7 100644 --- a/ansible/install/roles/browbeat-results/tasks/main.yml +++ b/ansible/install/roles/browbeat-results/tasks/main.yml @@ -4,7 +4,7 @@ # - name: Install httpd - yum: + package: name: httpd state: present become: true diff --git a/ansible/install/roles/collectd-generic/tasks/main.yml b/ansible/install/roles/collectd-generic/tasks/main.yml index 978c5d2f6..e6fd53000 100644 --- a/ansible/install/roles/collectd-generic/tasks/main.yml +++ b/ansible/install/roles/collectd-generic/tasks/main.yml @@ -4,14 +4,14 @@ # - name: Install collectd rpms - yum: + package: name: "{{ item }}" state: present become: true with_items: "{{collectd_packages[config_type]}}" - name: Install package that provides semanage - yum: + package: name: policycoreutils-python state: present become: true diff --git a/ansible/install/roles/curator/tasks/main.yml b/ansible/install/roles/curator/tasks/main.yml index 659741756..2ca1ca8e7 100644 --- a/ansible/install/roles/curator/tasks/main.yml +++ b/ansible/install/roles/curator/tasks/main.yml @@ -20,7 +20,9 @@ when: install_curator_tool - name: Install curator and python-setuptools - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - python-elasticsearch-curator diff --git a/ansible/install/roles/elasticsearch/tasks/main.yml b/ansible/install/roles/elasticsearch/tasks/main.yml index 22fc292f0..5c8dc7c37 100644 --- a/ansible/install/roles/elasticsearch/tasks/main.yml +++ b/ansible/install/roles/elasticsearch/tasks/main.yml @@ -13,7 +13,9 @@ become: true - name: Install elasticsearch and openjdk - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - elasticsearch diff --git a/ansible/install/roles/epel/handlers/main.yml b/ansible/install/roles/epel/handlers/main.yml index 293acc682..1d05101c6 100644 --- a/ansible/install/roles/epel/handlers/main.yml +++ b/ansible/install/roles/epel/handlers/main.yml @@ -3,7 +3,7 @@ # Handler to clean up EPEL whenever it is used # - name: remove_epel - yum: + package: name: epel-release state: absent ignore_errors: true diff --git a/ansible/install/roles/epel/tasks/main.yml b/ansible/install/roles/epel/tasks/main.yml index 38aad64de..5a182eed6 100644 --- a/ansible/install/roles/epel/tasks/main.yml +++ b/ansible/install/roles/epel/tasks/main.yml @@ -4,7 +4,9 @@ # - name: Remove old EPEL - yum: name=epel-release state=absent + package: + name: epel-release + state: absent become: true # The fedoraproject CDN has problems sometimes, this will keep trying @@ -21,7 +23,9 @@ # Same as above but with the Centos CDN - name: Check for EPEL repo - yum: "name={{ epel7_rpm }} state=present" + package: + name: "{{ epel7_rpm }}" + state: present become: true register: install_result until: install_result is success diff --git a/ansible/install/roles/filebeat/tasks/main.yml b/ansible/install/roles/filebeat/tasks/main.yml index 6d629c672..4a2469c34 100644 --- a/ansible/install/roles/filebeat/tasks/main.yml +++ b/ansible/install/roles/filebeat/tasks/main.yml @@ -20,7 +20,9 @@ when: (logging_backend != 'fluentd') - name: Install filebeat rpms - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - filebeat @@ -63,7 +65,9 @@ when: (logging_backend != 'fluentd') - name: Install rsyslogd for fluentd - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - rsyslog diff --git a/ansible/install/roles/grafana/tasks/main.yml b/ansible/install/roles/grafana/tasks/main.yml index 842a0d86d..2adc3c093 100644 --- a/ansible/install/roles/grafana/tasks/main.yml +++ b/ansible/install/roles/grafana/tasks/main.yml @@ -24,7 +24,9 @@ become: True - name: Install grafana RPM - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - grafana diff --git a/ansible/install/roles/graphite/tasks/main.yml b/ansible/install/roles/graphite/tasks/main.yml index 440ef0a88..d92de38ea 100644 --- a/ansible/install/roles/graphite/tasks/main.yml +++ b/ansible/install/roles/graphite/tasks/main.yml @@ -4,7 +4,7 @@ # - name: Install graphite rpms - yum: + package: name: "{{ item }}" state: present become: true diff --git a/ansible/install/roles/kibana/tasks/main.yml b/ansible/install/roles/kibana/tasks/main.yml index 5eb6ea21d..f0cdd1764 100644 --- a/ansible/install/roles/kibana/tasks/main.yml +++ b/ansible/install/roles/kibana/tasks/main.yml @@ -28,7 +28,9 @@ no_log: true - name: Install local rsyslogd for fluentd - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - rsyslog @@ -48,7 +50,9 @@ when: rsyslog_updated != 0 - name: Install kibana rpms - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - kibana diff --git a/ansible/install/roles/logstash/tasks/main.yml b/ansible/install/roles/logstash/tasks/main.yml index 130a216bb..9bb9558ba 100644 --- a/ansible/install/roles/logstash/tasks/main.yml +++ b/ansible/install/roles/logstash/tasks/main.yml @@ -13,7 +13,9 @@ become: true - name: Install logstash rpms - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - logstash diff --git a/ansible/install/roles/nginx/tasks/main.yml b/ansible/install/roles/nginx/tasks/main.yml index 11b8f2d13..44772a851 100644 --- a/ansible/install/roles/nginx/tasks/main.yml +++ b/ansible/install/roles/nginx/tasks/main.yml @@ -4,7 +4,9 @@ # - name: Install nginx, httpd-tools, httplib2, libsemanage-python - yum: name={{ item }} state=present + package: + name: "{{ item }}" + state: present become: true with_items: - nginx diff --git a/ansible/install/roles/rsyslog-install/tasks/main.yml b/ansible/install/roles/rsyslog-install/tasks/main.yml index bb8928e7f..4b8a6a87f 100644 --- a/ansible/install/roles/rsyslog-install/tasks/main.yml +++ b/ansible/install/roles/rsyslog-install/tasks/main.yml @@ -2,7 +2,7 @@ # Installs rsyslog packages, used with other rsyslog roles - name: Install rsyslog and rsyslog-elasticsearch - yum: + package: name: "{{item}}" state: present become: true @@ -19,7 +19,7 @@ # We can't just add the repo and do an upgrade do to irresolvable # deps involving some rsyslog components have other package names - name: Remove 7.x rsyslog packages - yum: + package: name: "{{item}}" state: absent become: true @@ -46,7 +46,7 @@ when: install_rsyslog|failed - name: Install rsyslog 8 from external repo - yum: + package: name: "{{item}}" state: present disablerepo: "*" diff --git a/ansible/install/roles/rsyslog-templates/tasks/main.yml b/ansible/install/roles/rsyslog-templates/tasks/main.yml index 4c9caeffd..89039a809 100644 --- a/ansible/install/roles/rsyslog-templates/tasks/main.yml +++ b/ansible/install/roles/rsyslog-templates/tasks/main.yml @@ -90,7 +90,7 @@ become: true - name: Install selinux utils - yum: + package: name: policycoreutils-python state: present become: true diff --git a/ansible/install/roles/statsd-install/tasks/main.yml b/ansible/install/roles/statsd-install/tasks/main.yml index 34943e730..f4203c434 100644 --- a/ansible/install/roles/statsd-install/tasks/main.yml +++ b/ansible/install/roles/statsd-install/tasks/main.yml @@ -1,6 +1,8 @@ --- - name: Install StatsD - yum: name=statsd state=present + package: + name: statsd + state: present become: True - name: Create StatsD configuration folder