summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.tito/packages/openshift-ansible2
-rw-r--r--README_AWS.md27
-rw-r--r--docs/best_practices_guide.adoc47
-rw-r--r--inventory/byo/hosts.aep.example3
-rw-r--r--inventory/byo/hosts.origin.example3
-rw-r--r--inventory/byo/hosts.ose.example3
-rw-r--r--openshift-ansible.spec21
-rw-r--r--playbooks/adhoc/uninstall.yml36
-rw-r--r--playbooks/aws/ansible-tower/launch.yml4
-rw-r--r--playbooks/common/openshift-cluster/scaleup.yml2
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml4
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml20
-rw-r--r--playbooks/common/openshift-master/config.yml17
-rw-r--r--playbooks/common/openshift-node/config.yml2
-rw-r--r--playbooks/gce/openshift-cluster/join_node.yml2
-rw-r--r--roles/ansible/tasks/main.yml11
-rw-r--r--roles/ansible_tower/tasks/main.yaml2
-rw-r--r--roles/ansible_tower_cli/tasks/main.yml2
-rw-r--r--roles/cockpit/tasks/main.yml16
-rw-r--r--roles/copr_cli/tasks/main.yml10
-rw-r--r--roles/docker/tasks/main.yml9
-rw-r--r--roles/etcd/tasks/main.yml7
-rw-r--r--roles/flannel/tasks/main.yml8
-rw-r--r--roles/fluentd_master/tasks/main.yml11
-rw-r--r--roles/fluentd_node/tasks/main.yml11
-rw-r--r--roles/haproxy/tasks/main.yml11
-rw-r--r--roles/kube_nfs_volumes/tasks/main.yml7
-rw-r--r--roles/kube_nfs_volumes/tasks/nfs.yml9
-rw-r--r--roles/nickhammond.logrotate/tasks/main.yml2
-rw-r--r--roles/openshift_ansible_inventory/tasks/main.yml14
-rw-r--r--roles/openshift_common/tasks/main.yml7
-rw-r--r--roles/openshift_examples/README.md9
-rw-r--r--roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7-v1-0.json285
-rw-r--r--roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7.json207
-rw-r--r--roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7-v1-0.json254
-rw-r--r--roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7.json196
-rw-r--r--roles/openshift_expand_partition/tasks/main.yml7
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py1
-rw-r--r--roles/openshift_facts/tasks/main.yml11
-rw-r--r--roles/openshift_master/tasks/main.yml27
-rw-r--r--roles/openshift_master_ca/tasks/main.yml9
-rw-r--r--roles/openshift_node/tasks/main.yml24
-rw-r--r--roles/openshift_node/tasks/storage_plugins/ceph.yml11
-rw-r--r--roles/openshift_node/tasks/storage_plugins/glusterfs.yml11
-rw-r--r--roles/openshift_repos/handlers/main.yml7
-rw-r--r--roles/openshift_repos/tasks/main.yaml25
-rw-r--r--roles/openshift_storage_nfs_lvm/tasks/nfs.yml9
-rw-r--r--roles/os_env_extras/tasks/main.yaml11
-rw-r--r--roles/os_firewall/tasks/firewall/firewalld.yml12
-rw-r--r--roles/os_firewall/tasks/firewall/iptables.yml15
-rw-r--r--roles/os_update_latest/tasks/main.yml7
-rw-r--r--roles/tito/tasks/main.yml4
-rw-r--r--utils/src/ooinstall/openshift_ansible.py12
53 files changed, 267 insertions, 1217 deletions
diff --git a/.tito/packages/openshift-ansible b/.tito/packages/openshift-ansible
index 7432a2dca..b7dc52080 100644
--- a/.tito/packages/openshift-ansible
+++ b/.tito/packages/openshift-ansible
@@ -1 +1 @@
-3.0.17-1 ./
+3.0.19-1 ./
diff --git a/README_AWS.md b/README_AWS.md
index 16ccb07e8..f8ecaec49 100644
--- a/README_AWS.md
+++ b/README_AWS.md
@@ -67,12 +67,12 @@ By default, a cluster is launched with the following configuration:
- Keypair name: libra
- Security group: public
-Master specific defaults:
+#### Master specific defaults:
- Master root volume size: 10 (in GiBs)
- Master root volume type: gp2
- Master root volume iops: 500 (only applicable when volume type is io1)
-Node specific defaults:
+#### Node specific defaults:
- Node root volume size: 10 (in GiBs)
- Node root volume type: gp2
- Node root volume iops: 500 (only applicable when volume type is io1)
@@ -81,16 +81,26 @@ Node specific defaults:
- Docker volume type: gp2 (only applicable if ephemeral is false)
- Docker volume iops: 500 (only applicable when volume type is io1)
-Specifying ec2 instance type.
-All instances:
+### Specifying ec2 instance type.
+
+#### All instances:
+
- export ec2_instance_type='m4.large'
-Master instances:
+
+#### Master instances:
+
- export ec2_master_instance_type='m4.large'
-Infra node instances:
+
+#### Infra node instances:
+
- export ec2_infra_instance_type='m4.large'
-Non-infra node instances:
+
+#### Non-infra node instances:
+
- export ec2_node_instance_type='m4.large'
-etcd instances:
+
+#### etcd instances:
+
- export ec2_etcd_instance_type='m4.large'
If needed, these values can be changed by setting environment variables on your system.
@@ -114,6 +124,7 @@ If needed, these values can be changed by setting environment variables on your
Install Dependencies
--------------------
1. Ansible requires python-boto for aws operations:
+
RHEL/CentOS/Fedora
```
yum install -y ansible python-boto pyOpenSSL
diff --git a/docs/best_practices_guide.adoc b/docs/best_practices_guide.adoc
index 08d95b2b8..6b744333c 100644
--- a/docs/best_practices_guide.adoc
+++ b/docs/best_practices_guide.adoc
@@ -466,3 +466,50 @@ If you want to use default with variables that evaluate to false you have to set
In other words, normally the `default` filter will only replace the value if it's undefined. By setting the second parameter to `true`, it will also replace the value if it defaults to a false value in python, so None, empty list, empty string, etc.
This is almost always more desirable than an empty list, string, etc.
+
+=== Yum and DNF
+'''
+[cols="2v,v"]
+|===
+| **Rule**
+| Package installation MUST use ansible action module to abstract away dnf/yum.
+| Package installation MUST use name= and state=present rather than pkg= and state=installed respectively.
+|===
+[cols="2v,v"]
+|===
+| **Rule**
+| Package installation MUST use name= and state=present rather than pkg= and state=installed respectively.
+|===
+
+This is done primarily because if you're registering the result of the
+installation and you have two conditional tasks based on whether or not yum or
+dnf are in use you'll end up inadvertently overwriting the value. It also
+reduces duplication. name= and state=present are common between dnf and yum
+modules.
+
+.Bad:
+[source,yaml]
+----
+---
+# tasks.yml
+- name: Install etcd (for etcdctl)
+ yum: name=etcd state=latest"
+ when: "ansible_pkg_mgr == yum"
+ register: install_result
+
+- name: Install etcd (for etcdctl)
+ dnf: name=etcd state=latest"
+ when: "ansible_pkg_mgr == dnf"
+ register: install_result
+----
+
+
+.Good:
+[source,yaml]
+----
+---
+# tasks.yml
+- name: Install etcd (for etcdctl)
+ action: "{{ ansible_pkg_mgr }} name=etcd state=latest"
+ register: install_result
+ ----
diff --git a/inventory/byo/hosts.aep.example b/inventory/byo/hosts.aep.example
index d5b872e06..096d806a3 100644
--- a/inventory/byo/hosts.aep.example
+++ b/inventory/byo/hosts.aep.example
@@ -21,6 +21,9 @@ ansible_ssh_user=root
# deployment type valid values are origin, online, atomic-enterprise, and openshift-enterprise
deployment_type=atomic-enterprise
+# Install the openshift examples
+#openshift_install_examples=true
+
# Enable cluster metrics
#use_cluster_metrics=true
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index 77a3a04b4..6f015c404 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -21,6 +21,9 @@ ansible_ssh_user=root
# deployment type valid values are origin, online, atomic-enterprise and openshift-enterprise
deployment_type=origin
+# Install the openshift examples
+#openshift_install_examples=true
+
# Enable cluster metrics
#use_cluster_metrics=true
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index 5a4310298..778bbfb3a 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -21,6 +21,9 @@ ansible_ssh_user=root
# deployment type valid values are origin, online, atomic-enterprise, and openshift-enterprise
deployment_type=openshift-enterprise
+# Install the openshift examples
+#openshift_install_examples=true
+
# Enable cluster metrics
#use_cluster_metrics=true
diff --git a/openshift-ansible.spec b/openshift-ansible.spec
index 930aa658f..4f3cdbed1 100644
--- a/openshift-ansible.spec
+++ b/openshift-ansible.spec
@@ -5,7 +5,7 @@
}
Name: openshift-ansible
-Version: 3.0.17
+Version: 3.0.19
Release: 1%{?dist}
Summary: Openshift and Atomic Enterprise Ansible
License: ASL 2.0
@@ -13,7 +13,7 @@ URL: https://github.com/openshift/openshift-ansible
Source0: https://github.com/openshift/openshift-ansible/archive/%{commit}/%{name}-%{version}.tar.gz
BuildArch: noarch
-Requires: ansible >= 1.9.3
+Requires: ansible >= 1.9.4
Requires: python2
%description
@@ -211,6 +211,7 @@ BuildArch: noarch
Summary: Openshift and Atomic Enterprise Ansible filter plugins
Requires: %{name} = %{version}
BuildArch: noarch
+Requires: pyOpenSSL
%description filter-plugins
%{summary}.
@@ -258,6 +259,22 @@ Atomic OpenShift Utilities includes
%changelog
+* Wed Dec 09 2015 Brenton Leanhardt <bleanhar@redhat.com> 3.0.19-1
+- Fix version dependent image streams (sdodson@redhat.com)
+- atomic-openshift-installer: Error handling on yaml loading
+ (smunilla@redhat.com)
+- Betterize AWS readme (jtslear@gmail.com)
+
+* Tue Dec 08 2015 Brenton Leanhardt <bleanhar@redhat.com> 3.0.18-1
+- Pass in and use first_master_ip as dnsIP for pre 3.1 nodes.
+ (abutcher@redhat.com)
+- Fix delete state (jdiaz@redhat.com)
+- Require pyOpenSSL (sdodson@redhat.com)
+- Update sync db-templates, image-streams, and quickstart-templates
+ (sdodson@redhat.com)
+- Clarify the preflight port check output (sdodson@redhat.com)
+- Fix missing dependency version locking (sdodson@redhat.com)
+
* Tue Dec 08 2015 Brenton Leanhardt <bleanhar@redhat.com> 3.0.17-1
- Improving output when gathering facts (bleanhar@redhat.com)
- Bug 1287977 - Incorrect check output from atomic-openshift-installer when
diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml
index 08a2ea6fb..9161076e5 100644
--- a/playbooks/adhoc/uninstall.yml
+++ b/playbooks/adhoc/uninstall.yml
@@ -47,40 +47,8 @@
- origin-node
- pcsd
- - yum: name={{ item }} state=absent
- when: ansible_pkg_mgr == "yum" and not is_atomic | bool
- with_items:
- - atomic-enterprise
- - atomic-enterprise-master
- - atomic-enterprise-node
- - atomic-enterprise-sdn-ovs
- - atomic-openshift
- - atomic-openshift-clients
- - atomic-openshift-master
- - atomic-openshift-node
- - atomic-openshift-sdn-ovs
- - corosync
- - etcd
- - openshift
- - openshift-master
- - openshift-node
- - openshift-sdn
- - openshift-sdn-ovs
- - openvswitch
- - origin
- - origin-clients
- - origin-master
- - origin-node
- - origin-sdn-ovs
- - pacemaker
- - pcs
- - tuned-profiles-atomic-enterprise-node
- - tuned-profiles-atomic-openshift-node
- - tuned-profiles-openshift-node
- - tuned-profiles-origin-node
-
- - dnf: name={{ item }} state=absent
- when: ansible_pkg_mgr == "dnf" and not is_atomic | bool
+ - action: "{{ ansible_pkg_mgr }} name={{ item }} state=absent"
+ when: not is_atomic | bool
with_items:
- atomic-enterprise
- atomic-enterprise-master
diff --git a/playbooks/aws/ansible-tower/launch.yml b/playbooks/aws/ansible-tower/launch.yml
index 850238ffb..fd6b15c32 100644
--- a/playbooks/aws/ansible-tower/launch.yml
+++ b/playbooks/aws/ansible-tower/launch.yml
@@ -71,8 +71,8 @@
tasks:
- - name: Yum update
- yum: name=* state=latest
+ - name: Update All Things
+ action: "{{ ansible_pkg_mgr }} name=* state=latest"
# Apply the configs, seprate so that just the configs can be run by themselves
- include: config.yml
diff --git a/playbooks/common/openshift-cluster/scaleup.yml b/playbooks/common/openshift-cluster/scaleup.yml
index e1778e41e..d2ba3fc7a 100644
--- a/playbooks/common/openshift-cluster/scaleup.yml
+++ b/playbooks/common/openshift-cluster/scaleup.yml
@@ -3,6 +3,4 @@
- include: ../openshift-node/config.yml
vars:
- osn_cluster_dns_domain: "{{ hostvars[groups.oo_first_master.0].openshift.dns.domain }}"
- osn_cluster_dns_ip: "{{ hostvars[groups.oo_first_master.0].openshift.dns.ip }}"
openshift_deployment_type: "{{ deployment_type }}"
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
index 9f7e49b93..63c8ef756 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
@@ -11,7 +11,7 @@
openshift_version: "{{ openshift_pkg_version | default('') }}"
tasks:
- name: Upgrade master packages
- yum: pkg={{ openshift.common.service_type }}-master{{ openshift_version }} state=latest
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-master{{ openshift_version }} state=latest"
- name: Restart master services
service: name="{{ openshift.common.service_type}}-master" state=restarted
@@ -21,7 +21,7 @@
openshift_version: "{{ openshift_pkg_version | default('') }}"
tasks:
- name: Upgrade node packages
- yum: pkg={{ openshift.common.service_type }}-node{{ openshift_version }} state=latest
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-node{{ openshift_version }} state=latest"
- name: Restart node services
service: name="{{ openshift.common.service_type }}-node" state=restarted
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
index 0309e8a77..c31103f3e 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
@@ -54,8 +54,8 @@
- name: Verify upgrade can proceed
hosts: oo_masters_to_config:oo_nodes_to_config
tasks:
- - name: Clean yum cache
- command: yum clean all
+ - name: Clean package cache
+ command: "{{ ansible_pkg_mgr }} clean all"
- set_fact:
g_new_service_name: "{{ 'origin' if deployment_type =='origin' else 'atomic-openshift' }}"
@@ -149,9 +149,7 @@
when: (embedded_etcd | bool) and (etcd_disk_usage.stdout|int > avail_disk.stdout|int)
- name: Install etcd (for etcdctl)
- yum:
- pkg: etcd
- state: latest
+ action: "{{ ansible_pkg_mgr }} name=etcd state=latest"
- name: Generate etcd backup
command: >
@@ -222,17 +220,13 @@
openshift_version: "{{ openshift_pkg_version | default('') }}"
tasks:
- name: Upgrade to latest available kernel
- yum:
- pkg: kernel
- state: latest
+ action: "{{ ansible_pkg_mgr}} name=kernel state=latest"
- name: Upgrade master packages
- command: yum update -y {{ openshift.common.service_type }}-master{{ openshift_version }}
+ command: "{{ ansible_pkg_mgr}} update -y {{ openshift.common.service_type }}-master{{ openshift_version }}"
- name: Ensure python-yaml present for config upgrade
- yum:
- pkg: PyYAML
- state: installed
+ action: "{{ ansible_pkg_mgr }} name=PyYAML state=present"
- name: Upgrade master configuration
openshift_upgrade_config:
@@ -380,7 +374,7 @@
- openshift_facts
tasks:
- name: Upgrade node packages
- command: yum update -y {{ openshift.common.service_type }}-node{{ openshift_version }}
+ command: "{{ ansible_pkg_mgr }} update -y {{ openshift.common.service_type }}-node{{ openshift_version }}"
- name: Restart node service
service: name="{{ openshift.common.service_type }}-node" state=restarted
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index becd68dbe..3151bf113 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -245,26 +245,18 @@
msg: "openshift_master_session_auth_secrets and openshift_master_encryption_secrets must be equal length"
when: (openshift_master_session_auth_secrets is defined and openshift_master_session_encryption_secrets is defined) and (openshift_master_session_auth_secrets | length != openshift_master_session_encryption_secrets | length)
- name: Install OpenSSL package
- action: "{{ansible_pkg_mgr}} pkg=openssl state=present"
+ action: "{{ ansible_pkg_mgr }} name=openssl state=present"
- name: Generate session authentication key
command: /usr/bin/openssl rand -base64 24
register: session_auth_output
- with_sequence: count=1
when: openshift_master_session_auth_secrets is undefined
- name: Generate session encryption key
command: /usr/bin/openssl rand -base64 24
register: session_encryption_output
- with_sequence: count=1
when: openshift_master_session_encryption_secrets is undefined
- set_fact:
- session_auth_secret: "{{ openshift_master_session_auth_secrets
- | default(session_auth_output.results
- | oo_collect(attribute='stdout')
- | list) }}"
- session_encryption_secret: "{{ openshift_master_session_encryption_secrets
- | default(session_encryption_output.results
- | oo_collect(attribute='stdout')
- | list) }}"
+ session_auth_secret: "{{ openshift_master_session_auth_secrets | default([session_auth_output.stdout]) }}"
+ session_encryption_secret: "{{ openshift_master_session_encryption_secrets | default([session_encryption_output.stdout]) }}"
- name: Parse named certificates
hosts: localhost
@@ -349,7 +341,8 @@
roles:
- role: openshift_master_cluster
when: openshift_master_ha | bool and openshift.master.cluster_method == "pacemaker"
- - openshift_examples
+ - role: openshift_examples
+ when: openshift.common.install_examples | bool
- role: openshift_cluster_metrics
when: openshift.common.use_cluster_metrics | bool
- role: openshift_manageiq
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index 2b6171cb3..952a9fd51 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/playbooks/common/openshift-node/config.yml
@@ -158,8 +158,10 @@
vars:
sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}"
openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
+ # TODO: Prefix flannel role variables.
etcd_urls: "{{ hostvars[groups.oo_first_master.0].openshift.master.etcd_urls }}"
embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"
+ openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}"
pre_tasks:
- name: Ensure certificate directory exists
file:
diff --git a/playbooks/gce/openshift-cluster/join_node.yml b/playbooks/gce/openshift-cluster/join_node.yml
index c8f6065cd..5ae3a8fef 100644
--- a/playbooks/gce/openshift-cluster/join_node.yml
+++ b/playbooks/gce/openshift-cluster/join_node.yml
@@ -45,5 +45,3 @@
openshift_use_openshift_sdn: true
openshift_node_labels: "{{ lookup('oo_option', 'openshift_node_labels') }} "
os_sdn_network_plugin_name: "redhat/openshift-ovs-subnet"
- osn_cluster_dns_domain: "{{ hostvars[groups.oo_first_master.0].openshift.dns.domain }}"
- osn_cluster_dns_ip: "{{ hostvars[groups.oo_first_master.0].cluster_dns_ip }}"
diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml
index f79273824..2a6ac7713 100644
--- a/roles/ansible/tasks/main.yml
+++ b/roles/ansible/tasks/main.yml
@@ -2,16 +2,7 @@
# Install ansible client
- name: Install Ansible
- yum:
- pkg: ansible
- state: installed
- when: ansible_pkg_mgr == "yum"
-
-- name: Install Ansible
- dnf:
- pkg: ansible
- state: installed
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=ansible state=present"
- include: config.yml
vars:
diff --git a/roles/ansible_tower/tasks/main.yaml b/roles/ansible_tower/tasks/main.yaml
index b7757214d..36fc9b282 100644
--- a/roles/ansible_tower/tasks/main.yaml
+++ b/roles/ansible_tower/tasks/main.yaml
@@ -1,6 +1,6 @@
---
- name: install some useful packages
- yum: name={{ item }}
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items:
- git
- python-pip
diff --git a/roles/ansible_tower_cli/tasks/main.yml b/roles/ansible_tower_cli/tasks/main.yml
index 41fac22a0..0c5163b50 100644
--- a/roles/ansible_tower_cli/tasks/main.yml
+++ b/roles/ansible_tower_cli/tasks/main.yml
@@ -1,6 +1,6 @@
---
- name: Install python-ansible-tower-cli
- yum: name=python-ansible-tower-cli
+ action: "{{ ansible_pkg_mgr }} name=python-ansible-tower-cli state=present"
- template:
src: tower_cli.cfg.j2
diff --git a/roles/cockpit/tasks/main.yml b/roles/cockpit/tasks/main.yml
index 8410e7c90..b90e7dfd6 100644
--- a/roles/cockpit/tasks/main.yml
+++ b/roles/cockpit/tasks/main.yml
@@ -1,25 +1,11 @@
---
- name: Install cockpit-ws
- yum:
- name: "{{ item }}"
- state: present
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items:
- cockpit-ws
- cockpit-shell
- cockpit-bridge
- "{{ cockpit_plugins }}"
- when: ansible_pkg_mgr == "yum"
-
-- name: Install cockpit-ws
- dnf:
- name: "{{ item }}"
- state: present
- with_items:
- - cockpit-ws
- - cockpit-shell
- - cockpit-bridge
- - "{{ cockpit_plugins }}"
- when: ansible_pkg_mgr == "dnf"
- name: Enable cockpit-ws
service:
diff --git a/roles/copr_cli/tasks/main.yml b/roles/copr_cli/tasks/main.yml
index f8496199d..4bfd551d3 100644
--- a/roles/copr_cli/tasks/main.yml
+++ b/roles/copr_cli/tasks/main.yml
@@ -1,10 +1,2 @@
---
-- yum:
- name: copr-cli
- state: present
- when: ansible_pkg_mgr == "yum"
-
-- dnf:
- name: copr-cli
- state: present
- when: ansible_pkg_mgr == "dnf"
+- action: "{{ ansible_pkg_mgr }} name=copr-cli state=present"
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 857674454..e94ebe3e1 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -1,13 +1,8 @@
---
# tasks file for docker
- name: Install docker
- yum: pkg=docker
- when: ansible_pkg_mgr == "yum"
-
-- name: Install docker
- dnf: pkg=docker
- when: ansible_pkg_mgr == "dnf"
-
+ action: "{{ ansible_pkg_mgr }} name=docker state=present"
+
- name: enable and start the docker service
service: name=docker enabled=yes state=started
diff --git a/roles/etcd/tasks/main.yml b/roles/etcd/tasks/main.yml
index efaab5f31..61892fe06 100644
--- a/roles/etcd/tasks/main.yml
+++ b/roles/etcd/tasks/main.yml
@@ -8,12 +8,7 @@
when: "'ipv4' not in hostvars[inventory_hostname]['ansible_' ~ etcd_interface] or 'address' not in hostvars[inventory_hostname]['ansible_' ~ etcd_interface].ipv4"
- name: Install etcd
- yum: pkg=etcd-2.* state=present
- when: ansible_pkg_mgr == "yum"
-
-- name: Install etcd
- dnf: pkg=etcd* state=present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=etcd-2.* state=present"
- name: Validate permissions on the config dir
file:
diff --git a/roles/flannel/tasks/main.yml b/roles/flannel/tasks/main.yml
index 86e1bc96e..1e86176ea 100644
--- a/roles/flannel/tasks/main.yml
+++ b/roles/flannel/tasks/main.yml
@@ -1,13 +1,7 @@
---
- name: Install flannel
sudo: true
- yum: pkg=flannel state=present
- when: ansible_pkg_mgr == "yum"
-
-- name: Install flannel
- sudo: true
- dnf: pkg=flannel state=present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=flannel state=present"
- name: Set flannel etcd url
sudo: true
diff --git a/roles/fluentd_master/tasks/main.yml b/roles/fluentd_master/tasks/main.yml
index 43c499b4d..65c67fe8d 100644
--- a/roles/fluentd_master/tasks/main.yml
+++ b/roles/fluentd_master/tasks/main.yml
@@ -1,16 +1,7 @@
---
# TODO: Update fluentd install and configuration when packaging is complete
- name: download and install td-agent
- yum:
- name: 'http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm'
- state: present
- when: ansible_pkg_mgr == "yum"
-
-- name: download and install td-agent
- dnf:
- name: 'http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm'
- state: present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name='http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm' state=present"
- name: Verify fluentd plugin installed
command: '/opt/td-agent/embedded/bin/gem query -i fluent-plugin-kubernetes'
diff --git a/roles/fluentd_node/tasks/main.yml b/roles/fluentd_node/tasks/main.yml
index 827a1c075..85488b55e 100644
--- a/roles/fluentd_node/tasks/main.yml
+++ b/roles/fluentd_node/tasks/main.yml
@@ -1,16 +1,7 @@
---
# TODO: Update fluentd install and configuration when packaging is complete
- name: download and install td-agent
- yum:
- name: 'http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm'
- state: present
- when: ansible_pkg_mgr == "yum"
-
-- name: download and install td-agent
- dnf:
- name: 'http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm'
- state: present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name='http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm' state=present"
- name: Verify fluentd plugin installed
command: '/opt/td-agent/embedded/bin/gem query -i fluent-plugin-kubernetes'
diff --git a/roles/haproxy/tasks/main.yml b/roles/haproxy/tasks/main.yml
index 5d015fadd..106ab8489 100644
--- a/roles/haproxy/tasks/main.yml
+++ b/roles/haproxy/tasks/main.yml
@@ -1,15 +1,6 @@
---
- name: Install haproxy
- yum:
- pkg: haproxy
- state: present
- when: ansible_pkg_mgr == "yum"
-
-- name: Install haproxy
- dnf:
- pkg: haproxy
- state: present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=haproxy state=present"
- name: Configure haproxy
template:
diff --git a/roles/kube_nfs_volumes/tasks/main.yml b/roles/kube_nfs_volumes/tasks/main.yml
index 3fcb9fd18..2cc35844c 100644
--- a/roles/kube_nfs_volumes/tasks/main.yml
+++ b/roles/kube_nfs_volumes/tasks/main.yml
@@ -1,11 +1,6 @@
---
- name: Install pyparted (RedHat/Fedora)
- yum: name=pyparted,python-httplib2 state=present
- when: ansible_pkg_mgr == "yum"
-
-- name: Install pyparted (RedHat/Fedora)
- dnf: name=pyparted,python-httplib2 state=present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=pyparted,python-httplib2 state=present"
- name: partition the drives
partitionpool: disks={{ disks }} force={{ force }} sizes={{ sizes }}
diff --git a/roles/kube_nfs_volumes/tasks/nfs.yml b/roles/kube_nfs_volumes/tasks/nfs.yml
index a58a7b824..eaec28544 100644
--- a/roles/kube_nfs_volumes/tasks/nfs.yml
+++ b/roles/kube_nfs_volumes/tasks/nfs.yml
@@ -1,11 +1,6 @@
---
-- name: Install NFS server on Fedora/Red Hat
- yum: name=nfs-utils state=present
- when: ansible_pkg_mgr == "yum"
-
-- name: Install NFS server on Fedora/Red Hat
- dnf: name=nfs-utils state=present
- when: ansible_pkg_mgr == "dnf"
+- name: Install NFS server
+ action: "{{ ansible_pkg_mgr }} name=nfs-utils state=present"
- name: Start rpcbind on Fedora/Red Hat
service: name=rpcbind state=started enabled=yes
diff --git a/roles/nickhammond.logrotate/tasks/main.yml b/roles/nickhammond.logrotate/tasks/main.yml
index fda23e05e..0a0cf1fae 100644
--- a/roles/nickhammond.logrotate/tasks/main.yml
+++ b/roles/nickhammond.logrotate/tasks/main.yml
@@ -1,6 +1,6 @@
---
- name: nickhammond.logrotate | Install logrotate
- action: "{{ansible_pkg_mgr}} pkg=logrotate state=present"
+ action: "{{ ansible_pkg_mgr }} name=logrotate state=present"
- name: nickhammond.logrotate | Setup logrotate.d scripts
template:
diff --git a/roles/openshift_ansible_inventory/tasks/main.yml b/roles/openshift_ansible_inventory/tasks/main.yml
index 2b99f8bcd..4a0968686 100644
--- a/roles/openshift_ansible_inventory/tasks/main.yml
+++ b/roles/openshift_ansible_inventory/tasks/main.yml
@@ -1,17 +1,5 @@
---
-- yum:
- name: "{{ item }}"
- state: present
- when: ansible_pkg_mgr == "yum"
- with_items:
- - openshift-ansible-inventory
- - openshift-ansible-inventory-aws
- - openshift-ansible-inventory-gce
-
-- dnf:
- name: "{{ item }}"
- state: present
- when: ansible_pkg_mgr == "dnf"
+- action: "{{ ansible_pkg_mgr }} name={{ item}} state=present"
with_items:
- openshift-ansible-inventory
- openshift-ansible-inventory-aws
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
index c0982290d..c34f42838 100644
--- a/roles/openshift_common/tasks/main.yml
+++ b/roles/openshift_common/tasks/main.yml
@@ -14,6 +14,7 @@
cluster_id: "{{ openshift_cluster_id | default('default') }}"
debug_level: "{{ openshift_debug_level | default(2) }}"
hostname: "{{ openshift_hostname | default(None) }}"
+ install_examples: "{{ openshift_install_examples | default(True) }}"
ip: "{{ openshift_ip | default(None) }}"
public_hostname: "{{ openshift_public_hostname | default(None) }}"
public_ip: "{{ openshift_public_ip | default(None) }}"
@@ -24,6 +25,12 @@
use_flannel: "{{ openshift_use_flannel | default(None) }}"
use_manageiq: "{{ openshift_use_manageiq | default(None) }}"
+- name: Install the base package for versioning
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') }} state=present"
+
+- name: Set version facts
+ openshift_facts:
+
# For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
# hostname by default.
- set_fact:
diff --git a/roles/openshift_examples/README.md b/roles/openshift_examples/README.md
index 7d8735a0a..6ddbe7017 100644
--- a/roles/openshift_examples/README.md
+++ b/roles/openshift_examples/README.md
@@ -11,6 +11,13 @@ ansible.
Requirements
------------
+Facts
+-----
+
+| Name | Default Value | Description |
+-----------------------------|---------------|----------------------------------------|
+| openshift_install_examples | true | Runs the role with the below variables |
+
Role Variables
--------------
@@ -32,7 +39,7 @@ Example Playbook
TODO
----
Currently we use `oc create -f` against various files and we accept non zero return code as a success
-if (and only iff) stderr also contains the string 'already exists'. This means that if one object in the file exists already
+if (and only if) stderr also contains the string 'already exists'. This means that if one object in the file exists already
but others fail to create you won't be aware of the failure. This also means that we do not currently support
updating existing objects.
diff --git a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7-v1-0.json b/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7-v1-0.json
deleted file mode 100644
index 268d680f4..000000000
--- a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7-v1-0.json
+++ /dev/null
@@ -1,285 +0,0 @@
-{
- "kind": "ImageStreamList",
- "apiVersion": "v1",
- "metadata": {},
- "items": [
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "ruby",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/ruby-20-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "2.0",
- "annotations": {
- "description": "Build and run Ruby 2.0 applications",
- "iconClass": "icon-ruby",
- "tags": "builder,ruby",
- "supports": "ruby:2.0,ruby",
- "version": "2.0",
- "sampleRepo": "https://github.com/openshift/ruby-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "nodejs",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/nodejs-010-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "0.10",
- "annotations": {
- "description": "Build and run NodeJS 0.10 applications",
- "iconClass": "icon-nodejs",
- "tags": "builder,nodejs",
- "supports":"nodejs:0.10,nodejs:0.1,nodejs",
- "version": "0.10",
- "sampleRepo": "https://github.com/openshift/nodejs-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "perl",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/perl-516-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "5.16",
- "annotations": {
- "description": "Build and run Perl 5.16 applications",
- "iconClass": "icon-perl",
- "tags": "builder,perl",
- "supports":"perl:5.16,perl",
- "version": "5.16",
- "sampleRepo": "https://github.com/openshift/dancer-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "php",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/php-55-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "5.5",
- "annotations": {
- "description": "Build and run PHP 5.5 applications",
- "iconClass": "icon-php",
- "tags": "builder,php",
- "supports":"php:5.5,php",
- "version": "5.5",
- "sampleRepo": "https://github.com/openshift/cakephp-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "python",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/python-33-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "3.3",
- "annotations": {
- "description": "Build and run Python 3.3 applications",
- "iconClass": "icon-python",
- "tags": "builder,python",
- "supports":"python:3.3,python",
- "version": "3.3",
- "sampleRepo": "https://github.com/openshift/django-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "wildfly",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/wildfly-81-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "8.1",
- "annotations": {
- "description": "Build and run Java applications on Wildfly 8.1",
- "iconClass": "icon-wildfly",
- "tags": "builder,wildfly,java",
- "supports":"wildfly:8.1,jee,java",
- "version": "8.1",
- "sampleRepo": "https://github.com/bparees/openshift-jee-sample.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "mysql",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/mysql-55-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "5.5",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "postgresql",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/postgresql-92-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "9.2",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "mongodb",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/mongodb-24-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "2.4",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "jenkins",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "openshift/jenkins-1-centos7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "1",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- }
- ]
-}
diff --git a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7.json b/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7.json
index 1a78b1279..268d680f4 100644
--- a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7.json
+++ b/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-centos7.json
@@ -11,13 +11,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/ruby-20-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "2.0"
- }
+ "name": "latest"
},
{
"name": "2.0",
@@ -30,23 +27,8 @@
"sampleRepo": "https://github.com/openshift/ruby-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/ruby-20-centos7:latest"
- }
- },
- {
- "name": "2.2",
- "annotations": {
- "description": "Build and run Ruby 2.2 applications",
- "iconClass": "icon-ruby",
- "tags": "builder,ruby",
- "supports": "ruby:2.2,ruby",
- "version": "2.2",
- "sampleRepo": "https://github.com/openshift/ruby-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/ruby-22-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -60,13 +42,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/nodejs-010-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "0.10"
- }
+ "name": "latest"
},
{
"name": "0.10",
@@ -79,8 +58,8 @@
"sampleRepo": "https://github.com/openshift/nodejs-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/nodejs-010-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -94,13 +73,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/perl-516-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "5.16"
- }
+ "name": "latest"
},
{
"name": "5.16",
@@ -113,25 +89,9 @@
"sampleRepo": "https://github.com/openshift/dancer-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/perl-516-centos7:latest"
- }
- },
- {
- "name": "5.20",
- "annotations": {
- "description": "Build and run Perl 5.20 applications",
- "iconClass": "icon-perl",
- "tags": "builder,perl",
- "supports":"perl:5.20,perl",
- "version": "5.20",
- "sampleRepo": "https://github.com/openshift/dancer-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/perl-520-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
-
}
]
}
@@ -144,13 +104,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/php-55-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "5.5"
- }
+ "name": "latest"
},
{
"name": "5.5",
@@ -163,23 +120,8 @@
"sampleRepo": "https://github.com/openshift/cakephp-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/php-55-centos7:latest"
- }
- },
- {
- "name": "5.6",
- "annotations": {
- "description": "Build and run PHP 5.6 applications",
- "iconClass": "icon-php",
- "tags": "builder,php",
- "supports":"php:5.6,php",
- "version": "5.6",
- "sampleRepo": "https://github.com/openshift/cakephp-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/php-56-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -193,13 +135,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/python-33-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "3.3"
- }
+ "name": "latest"
},
{
"name": "3.3",
@@ -212,38 +151,8 @@
"sampleRepo": "https://github.com/openshift/django-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/python-33-centos7:latest"
- }
- },
- {
- "name": "2.7",
- "annotations": {
- "description": "Build and run Python 2.7 applications",
- "iconClass": "icon-python",
- "tags": "builder,python",
- "supports":"python:2.7,python",
- "version": "2.7",
- "sampleRepo": "https://github.com/openshift/django-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/python-27-centos7:latest"
- }
- },
- {
- "name": "3.4",
- "annotations": {
- "description": "Build and run Python 3.4 applications",
- "iconClass": "icon-python",
- "tags": "builder,python",
- "supports":"python:3.4,python",
- "version": "3.4",
- "sampleRepo": "https://github.com/openshift/django-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/python-34-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -257,13 +166,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/wildfly-81-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "8.1"
- }
+ "name": "latest"
},
{
"name": "8.1",
@@ -276,8 +182,8 @@
"sampleRepo": "https://github.com/bparees/openshift-jee-sample.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/wildfly-81-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -291,26 +197,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/mysql-55-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "5.5"
- }
+ "name": "latest"
},
{
"name": "5.5",
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/mysql-55-centos7:latest"
- }
- },
- {
- "name": "5.6",
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/mysql-56-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -324,26 +220,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/postgresql-92-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "9.2"
- }
+ "name": "latest"
},
{
"name": "9.2",
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/postgresql-92-centos7:latest"
- }
- },
- {
- "name": "9.4",
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/postgresql-94-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -357,26 +243,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/mongodb-24-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "2.4"
- }
+ "name": "latest"
},
{
"name": "2.4",
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/mongodb-24-centos7:latest"
- }
- },
- {
- "name": "2.6",
- "from": {
- "Kind": "DockerImage",
- "Name": "centos/mongodb-26-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -390,19 +266,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "openshift/jenkins-1-centos7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "1"
- }
+ "name": "latest"
},
{
"name": "1",
"from": {
- "Kind": "DockerImage",
- "Name": "openshift/jenkins-1-centos7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
diff --git a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7-v1-0.json b/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7-v1-0.json
deleted file mode 100644
index aa62ebd53..000000000
--- a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7-v1-0.json
+++ /dev/null
@@ -1,254 +0,0 @@
-{
- "kind": "ImageStreamList",
- "apiVersion": "v1",
- "metadata": {},
- "items": [
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "ruby",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/ruby-20-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "2.0",
- "annotations": {
- "description": "Build and run Ruby 2.0 applications",
- "iconClass": "icon-ruby",
- "tags": "builder,ruby",
- "supports": "ruby:2.0,ruby",
- "version": "2.0",
- "sampleRepo": "https://github.com/openshift/ruby-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "nodejs",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/nodejs-010-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "0.10",
- "annotations": {
- "description": "Build and run NodeJS 0.10 applications",
- "iconClass": "icon-nodejs",
- "tags": "builder,nodejs",
- "supports":"nodejs:0.10,nodejs:0.1,nodejs",
- "version": "0.10",
- "sampleRepo": "https://github.com/openshift/nodejs-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "perl",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/perl-516-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "5.16",
- "annotations": {
- "description": "Build and run Perl 5.16 applications",
- "iconClass": "icon-perl",
- "tags": "builder,perl",
- "supports":"perl:5.16,perl",
- "version": "5.16",
- "sampleRepo": "https://github.com/openshift/dancer-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "php",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/php-55-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "5.5",
- "annotations": {
- "description": "Build and run PHP 5.5 applications",
- "iconClass": "icon-php",
- "tags": "builder,php",
- "supports":"php:5.5,php",
- "version": "5.5",
- "sampleRepo": "https://github.com/openshift/cakephp-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "python",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/python-33-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "3.3",
- "annotations": {
- "description": "Build and run Python 3.3 applications",
- "iconClass": "icon-python",
- "tags": "builder,python",
- "supports":"python:3.3,python",
- "version": "3.3",
- "sampleRepo": "https://github.com/openshift/django-ex.git"
- },
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "mysql",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/mysql-55-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "5.5",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "postgresql",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/postgresql-92-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "9.2",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "mongodb",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/mongodb-24-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "2.4",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- },
- {
- "kind": "ImageStream",
- "apiVersion": "v1",
- "metadata": {
- "name": "jenkins",
- "creationTimestamp": null
- },
- "spec": {
- "dockerImageRepository": "registry.access.redhat.com/openshift3/jenkins-1-rhel7",
- "tags": [
- {
- "name": "latest"
- },
- {
- "name": "1",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "latest"
- }
- }
- ]
- }
- }
- ]
-}
diff --git a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7.json b/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7.json
index d2a8cfb1d..aa62ebd53 100644
--- a/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7.json
+++ b/roles/openshift_examples/files/examples/v1.0/image-streams/image-streams-rhel7.json
@@ -11,13 +11,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/ruby-20-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "2.0"
- }
+ "name": "latest"
},
{
"name": "2.0",
@@ -30,23 +27,8 @@
"sampleRepo": "https://github.com/openshift/ruby-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/ruby-20-rhel7:latest"
- }
- },
- {
- "name": "2.2",
- "annotations": {
- "description": "Build and run Ruby 2.2 applications",
- "iconClass": "icon-ruby",
- "tags": "builder,ruby",
- "supports": "ruby:2.2,ruby",
- "version": "2.2",
- "sampleRepo": "https://github.com/openshift/ruby-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/ruby-22-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -60,13 +42,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/nodejs-010-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "0.10"
- }
+ "name": "latest"
},
{
"name": "0.10",
@@ -79,8 +58,8 @@
"sampleRepo": "https://github.com/openshift/nodejs-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/nodejs-010-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -94,13 +73,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/perl-516-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "5.16"
- }
+ "name": "latest"
},
{
"name": "5.16",
@@ -113,25 +89,9 @@
"sampleRepo": "https://github.com/openshift/dancer-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/perl-516-rhel7:latest"
- }
- },
- {
- "name": "5.20",
- "annotations": {
- "description": "Build and run Perl 5.20 applications",
- "iconClass": "icon-perl",
- "tags": "builder,perl",
- "supports":"perl:5.20,perl",
- "version": "5.20",
- "sampleRepo": "https://github.com/openshift/dancer-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/perl-520-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
-
}
]
}
@@ -144,13 +104,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/php-55-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "5.5"
- }
+ "name": "latest"
},
{
"name": "5.5",
@@ -163,23 +120,8 @@
"sampleRepo": "https://github.com/openshift/cakephp-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/php-55-rhel7:latest"
- }
- },
- {
- "name": "5.6",
- "annotations": {
- "description": "Build and run PHP 5.6 applications",
- "iconClass": "icon-php",
- "tags": "builder,php",
- "supports":"php:5.6,php",
- "version": "5.6",
- "sampleRepo": "https://github.com/openshift/cakephp-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/php-56-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -193,13 +135,10 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/python-33-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "3.3"
- }
+ "name": "latest"
},
{
"name": "3.3",
@@ -212,38 +151,8 @@
"sampleRepo": "https://github.com/openshift/django-ex.git"
},
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/python-33-rhel7:latest"
- }
- },
- {
- "name": "2.7",
- "annotations": {
- "description": "Build and run Python 2.7 applications",
- "iconClass": "icon-python",
- "tags": "builder,python",
- "supports":"python:2.7,python",
- "version": "2.7",
- "sampleRepo": "https://github.com/openshift/django-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/python-27-rhel7:latest"
- }
- },
- {
- "name": "3.4",
- "annotations": {
- "description": "Build and run Python 3.4 applications",
- "iconClass": "icon-python",
- "tags": "builder,python",
- "supports":"python:3.4,python",
- "version": "3.4",
- "sampleRepo": "https://github.com/openshift/django-ex.git"
- },
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/python-34-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -257,26 +166,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/mysql-55-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "5.5"
- }
+ "name": "latest"
},
{
"name": "5.5",
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/mysql-55-rhel7:latest"
- }
- },
- {
- "name": "5.6",
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/mysql-56-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -290,26 +189,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/postgresql-92-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "9.2"
- }
+ "name": "latest"
},
{
"name": "9.2",
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/postgresql-92-rhel7:latest"
- }
- },
- {
- "name": "9.4",
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/postgresql-94-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -323,26 +212,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/mongodb-24-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "2.4"
- }
+ "name": "latest"
},
{
"name": "2.4",
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/mongodb-24-rhel7:latest"
- }
- },
- {
- "name": "2.6",
- "from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/rhscl/mongodb-26-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
@@ -356,19 +235,16 @@
"creationTimestamp": null
},
"spec": {
+ "dockerImageRepository": "registry.access.redhat.com/openshift3/jenkins-1-rhel7",
"tags": [
{
- "name": "latest",
- "from": {
- "Kind": "ImageStreamTag",
- "Name": "1"
- }
+ "name": "latest"
},
{
"name": "1",
"from": {
- "Kind": "DockerImage",
- "Name": "registry.access.redhat.com/openshift3/jenkins-1-rhel7:latest"
+ "Kind": "ImageStreamTag",
+ "Name": "latest"
}
}
]
diff --git a/roles/openshift_expand_partition/tasks/main.yml b/roles/openshift_expand_partition/tasks/main.yml
index 42e7903fd..84d859553 100644
--- a/roles/openshift_expand_partition/tasks/main.yml
+++ b/roles/openshift_expand_partition/tasks/main.yml
@@ -1,11 +1,6 @@
---
- name: Ensure growpart is installed
- yum: pkg=cloud-utils-growpart state=present
- when: ansible_pkg_mgr == "yum"
-
-- name: Ensure growpart is installed
- dnf: pkg=cloud-utils-growpart state=present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=cloud-utils-growpart state=present"
- name: Grow the partitions
command: "growpart {{oep_drive}} {{oep_partition}}"
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 8b3402729..e557853b1 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1057,6 +1057,7 @@ class OpenShiftFacts(object):
common['client_binary'] = 'oc' if os.path.isfile('/usr/bin/oc') else 'osc'
common['admin_binary'] = 'oadm' if os.path.isfile('/usr/bin/oadm') else 'osadm'
common['dns_domain'] = 'cluster.local'
+ common['install_examples'] = True
defaults['common'] = common
if 'master' in roles:
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index 2e889d7d5..832f7ad84 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -7,16 +7,7 @@
- ansible_version | version_compare('1.9.0.1', 'ne')
- name: Ensure PyYaml is installed
- yum: pkg={{ item }} state=installed
- when: ansible_pkg_mgr == "yum"
- with_items:
- - PyYAML
-
-- name: Ensure PyYaml is installed
- dnf: pkg={{ item }} state=installed
- when: ansible_pkg_mgr == "dnf"
- with_items:
- - PyYAML
+ action: "{{ ansible_pkg_mgr }} name=PyYAML state=present"
- name: Gather Cluster facts
openshift_facts:
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 8a78f8f2a..bd3d8f90c 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -78,14 +78,7 @@
controller_lease_ttl: "{{ osm_controller_lease_ttl | default(None) }}"
- name: Install Master package
- yum: pkg={{ openshift.common.service_type }}-master{{ openshift_version }} state=present
- when: ansible_pkg_mgr == "yum"
- register: install_result
-
-- name: Install Master package
- dnf: pkg={{ openshift.common.service_type }}-master{{ openshift_version }} state=present
- when: ansible_pkg_mgr == "dnf"
- register: install_result
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-master{{ openshift_version }} state=present"
- name: Re-gather package dependent master facts
openshift_facts:
@@ -117,13 +110,8 @@
- restart master controllers
- name: Install httpd-tools if needed
- yum: pkg=httpd-tools state=present
- when: (ansible_pkg_mgr == "yum") and (item.kind == 'HTPasswdPasswordIdentityProvider')
- with_items: openshift.master.identity_providers
-
-- name: Install httpd-tools if needed
- dnf: pkg=httpd-tools state=present
- when: (ansible_pkg_mgr == "dnf") and (item.kind == 'HTPasswdPasswordIdentityProvider')
+ action: "{{ ansible_pkg_mgr }} name=httpd-tools state=present"
+ when: (item.kind == 'HTPasswdPasswordIdentityProvider')
with_items: openshift.master.identity_providers
- name: Ensure htpasswd directory exists
@@ -267,13 +255,8 @@
when: openshift_master_ha | bool and openshift.master.cluster_method == 'native'
- name: Install cluster packages
- yum: pkg=pcs state=present
- when: (ansible_pkg_mgr == "yum") and openshift_master_ha | bool and openshift.master.cluster_method == 'pacemaker'
- register: install_result
-
-- name: Install cluster packages
- dnf: pkg=pcs state=present
- when: (ansible_pkg_mgr == "dnf") and openshift_master_ha | bool and openshift.master.cluster_method == 'pacemaker'
+ action: "{{ ansible_pkg_mgr }} name=pcs state=present"
+ when: openshift_master_ha | bool and openshift.master.cluster_method == 'pacemaker'
register: install_result
- name: Start and enable cluster service
diff --git a/roles/openshift_master_ca/tasks/main.yml b/roles/openshift_master_ca/tasks/main.yml
index caac13be3..0db95a4eb 100644
--- a/roles/openshift_master_ca/tasks/main.yml
+++ b/roles/openshift_master_ca/tasks/main.yml
@@ -1,13 +1,6 @@
---
- name: Install the base package for admin tooling
- yum: pkg={{ openshift.common.service_type }}{{ openshift_version }} state=present
- when: ansible_pkg_mgr == "yum"
- register: install_result
-
-- name: Install the base package for admin tooling
- dnf: pkg={{ openshift.common.service_type }}{{ openshift_version }} state=present
- when: ansible_pkg_mgr == "dnf"
- register: install_result
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version }} state=present"
- name: Reload generated facts
openshift_facts:
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index 29e7eb532..eef7bec9a 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -14,7 +14,10 @@
hostname: "{{ openshift_hostname | default(none) }}"
public_hostname: "{{ openshift_public_hostname | default(none) }}"
deployment_type: "{{ openshift_deployment_type }}"
- dns_ip: "{{ openshift_dns_ip | default(openshift_master_cluster_vip | default(None, true), true) }}"
+ # TODO: Replace this with a lookup or filter plugin.
+ dns_ip: "{{ openshift_dns_ip
+ | default(openshift_master_cluster_vip
+ | default(None if openshift.common.version_greater_than_3_1_or_1_1 | bool else openshift_node_first_master_ip | default(None, true), true), true) }}"
- role: node
local_facts:
annotations: "{{ openshift_node_annotations | default(none) }}"
@@ -34,24 +37,11 @@
# We have to add tuned-profiles in the same transaction otherwise we run into depsolving
# problems because the rpms don't pin the version properly.
- name: Install Node package
- yum: pkg={{ openshift.common.service_type }}-node{{ openshift_version }},tuned-profiles-{{ openshift.common.service_type }}-node{{ openshift_version }} state=present
- when: ansible_pkg_mgr == "yum"
- register: node_install_result
-
-- name: Install Node package
- dnf: pkg={{ openshift.common.service_type }}-node{{ openshift_version }},tuned-profiles-{{ openshift.common.service_type }}-node{{ openshift_version }} state=present
- when: ansible_pkg_mgr == "dnf"
- register: node_install_result
-
-- name: Install sdn-ovs package
- yum: pkg={{ openshift.common.service_type }}-sdn-ovs{{ openshift_version }} state=present
- register: sdn_install_result
- when: ansible_pkg_mgr == "yum" and openshift.common.use_openshift_sdn
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-node{{ openshift_version }},tuned-profiles-{{ openshift.common.service_type }}-node{{ openshift_version }} state=present"
- name: Install sdn-ovs package
- dnf: pkg={{ openshift.common.service_type }}-sdn-ovs{{ openshift_version }} state=present
- register: sdn_install_result
- when: ansible_pkg_mgr == "dnf" and openshift.common.use_openshift_sdn
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-sdn-ovs{{ openshift_version }} state=present"
+ when: openshift.common.use_openshift_sdn
# TODO: add the validate parameter when there is a validation command to run
- name: Create the Node config
diff --git a/roles/openshift_node/tasks/storage_plugins/ceph.yml b/roles/openshift_node/tasks/storage_plugins/ceph.yml
index b5146dcac..10d0990a0 100644
--- a/roles/openshift_node/tasks/storage_plugins/ceph.yml
+++ b/roles/openshift_node/tasks/storage_plugins/ceph.yml
@@ -1,12 +1,3 @@
---
- name: Install Ceph storage plugin dependencies
- yum:
- pkg: ceph-common
- state: installed
- when: ansible_pkg_mgr == "yum"
-
-- name: Install Ceph storage plugin dependencies
- dnf:
- pkg: ceph-common
- state: installed
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=ceph-common state=present" \ No newline at end of file
diff --git a/roles/openshift_node/tasks/storage_plugins/glusterfs.yml b/roles/openshift_node/tasks/storage_plugins/glusterfs.yml
index a357023e1..1080646ee 100644
--- a/roles/openshift_node/tasks/storage_plugins/glusterfs.yml
+++ b/roles/openshift_node/tasks/storage_plugins/glusterfs.yml
@@ -1,15 +1,6 @@
---
- name: Install GlusterFS storage plugin dependencies
- yum:
- pkg: glusterfs-fuse
- state: installed
- when: ansible_pkg_mgr == "yum"
-
-- name: Install GlusterFS storage plugin dependencies
- dnf:
- pkg: glusterfs-fuse
- state: installed
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=glusterfs-fuse state=present"
- name: Set sebooleans to allow gluster storage plugin access from containers
seboolean:
diff --git a/roles/openshift_repos/handlers/main.yml b/roles/openshift_repos/handlers/main.yml
index fed4ab2f0..198fc7d6e 100644
--- a/roles/openshift_repos/handlers/main.yml
+++ b/roles/openshift_repos/handlers/main.yml
@@ -1,6 +1,3 @@
---
-- name: refresh yum cache
- command: yum clean all
-
-- name: refresh dnf cache
- command: dnf clean all
+- name: refresh cache
+ command: "{{ ansible_pkg_mgr }} clean all"
diff --git a/roles/openshift_repos/tasks/main.yaml b/roles/openshift_repos/tasks/main.yaml
index c55b5df89..9faf0dfd9 100644
--- a/roles/openshift_repos/tasks/main.yaml
+++ b/roles/openshift_repos/tasks/main.yaml
@@ -11,30 +11,21 @@
that: openshift.common.deployment_type in known_openshift_deployment_types
- name: Ensure libselinux-python is installed
- yum:
- pkg: libselinux-python
- state: present
- when: ansible_pkg_mgr == "yum"
-
-- name: Ensure libselinux-python is installed
- dnf:
- pkg: libselinux-python
- state: present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=libselinux-python state=present"
- name: Create any additional repos that are defined
template:
src: yum_repo.j2
dest: /etc/yum.repos.d/openshift_additional.repo
when: openshift_additional_repos | length > 0
- notify: refresh yum cache
+ notify: refresh cache
- name: Remove the additional repos if no longer defined
file:
dest: /etc/yum.repos.d/openshift_additional.repo
state: absent
when: openshift_additional_repos | length == 0
- notify: refresh yum cache
+ notify: refresh cache
- name: Remove any yum repo files for other deployment types RHEL/CentOS
file:
@@ -44,7 +35,7 @@
- '*/repos/*'
when: not (item | search("/files/" ~ openshift_deployment_type ~ "/repos")) and
(ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
- notify: refresh yum cache
+ notify: refresh cache
- name: Remove any yum repo files for other deployment types Fedora
file:
@@ -54,24 +45,24 @@
- '*/repos/*'
when: not (item | search("/files/fedora-" ~ openshift_deployment_type ~ "/repos")) and
(ansible_distribution == "Fedora")
- notify: refresh dnf cache
+ notify: refresh cache
- name: Configure gpg keys if needed
copy: src={{ item }} dest=/etc/pki/rpm-gpg/
with_fileglob:
- "{{ openshift_deployment_type }}/gpg_keys/*"
- notify: refresh yum cache
+ notify: refresh cache
- name: Configure yum repositories RHEL/CentOS
copy: src={{ item }} dest=/etc/yum.repos.d/
with_fileglob:
- "{{ openshift_deployment_type }}/repos/*"
- notify: refresh yum cache
+ notify: refresh cache
when: (ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
- name: Configure yum repositories Fedora
copy: src={{ item }} dest=/etc/yum.repos.d/
with_fileglob:
- "fedora-{{ openshift_deployment_type }}/repos/*"
- notify: refresh dnf cache
+ notify: refresh cache
when: (ansible_distribution == "Fedora")
diff --git a/roles/openshift_storage_nfs_lvm/tasks/nfs.yml b/roles/openshift_storage_nfs_lvm/tasks/nfs.yml
index bf23dfe98..cf1ba6f25 100644
--- a/roles/openshift_storage_nfs_lvm/tasks/nfs.yml
+++ b/roles/openshift_storage_nfs_lvm/tasks/nfs.yml
@@ -1,12 +1,7 @@
---
- name: Install NFS server
- yum: name=nfs-utils state=present
- when: ansible_pkg_mgr == "yum"
-
-- name: Install NFS server
- dnf: name=nfs-utils state=present
- when: ansible_pkg_mgr == "dnf"
-
+ action: "{{ ansible_pkg_mgr }} name=nfs-utils state=present"
+
- name: Start rpcbind
service: name=rpcbind state=started enabled=yes
diff --git a/roles/os_env_extras/tasks/main.yaml b/roles/os_env_extras/tasks/main.yaml
index 29599559c..cbf5c37f5 100644
--- a/roles/os_env_extras/tasks/main.yaml
+++ b/roles/os_env_extras/tasks/main.yaml
@@ -12,13 +12,4 @@
dest: /root/.vimrc
- name: Bash Completion
- yum:
- pkg: bash-completion
- state: installed
- when: ansible_pkg_mgr == "yum"
-
-- name: Bash Completion
- dnf:
- pkg: bash-completion
- state: installed
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=bash-completion state=present" \ No newline at end of file
diff --git a/roles/os_firewall/tasks/firewall/firewalld.yml b/roles/os_firewall/tasks/firewall/firewalld.yml
index cf2a2c733..ba12c6b0c 100644
--- a/roles/os_firewall/tasks/firewall/firewalld.yml
+++ b/roles/os_firewall/tasks/firewall/firewalld.yml
@@ -1,16 +1,6 @@
---
- name: Install firewalld packages
- yum:
- name: firewalld
- state: present
- when: ansible_pkg_mgr == "yum"
- register: install_result
-
-- name: Install firewalld packages
- dnf:
- name: firewalld
- state: present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=firewalld state=present"
register: install_result
- name: Check if iptables-services is installed
diff --git a/roles/os_firewall/tasks/firewall/iptables.yml b/roles/os_firewall/tasks/firewall/iptables.yml
index 36d51504c..d3a5b1fa7 100644
--- a/roles/os_firewall/tasks/firewall/iptables.yml
+++ b/roles/os_firewall/tasks/firewall/iptables.yml
@@ -1,22 +1,9 @@
---
- name: Install iptables packages
- yum:
- name: "{{ item }}"
- state: present
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items:
- iptables
- iptables-services
- when: ansible_pkg_mgr == "yum"
- register: install_result
-
-- name: Install iptables packages
- dnf:
- name: "{{ item }}"
- state: present
- with_items:
- - iptables
- - iptables-services
- when: ansible_pkg_mgr == "dnf"
register: install_result
- name: Check if firewalld is installed
diff --git a/roles/os_update_latest/tasks/main.yml b/roles/os_update_latest/tasks/main.yml
index 40eec8d35..2532059c0 100644
--- a/roles/os_update_latest/tasks/main.yml
+++ b/roles/os_update_latest/tasks/main.yml
@@ -1,8 +1,3 @@
---
- name: Update all packages
- yum: name=* state=latest
- when: ansible_pkg_mgr == "yum"
-
-- name: Update all packages
- dnf: name=* state=latest
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=* state=latest" \ No newline at end of file
diff --git a/roles/tito/tasks/main.yml b/roles/tito/tasks/main.yml
index f7b4ef363..3cf9e2bfd 100644
--- a/roles/tito/tasks/main.yml
+++ b/roles/tito/tasks/main.yml
@@ -1,4 +1,2 @@
---
-- yum:
- name: tito
- state: present
+- action: "{{ ansible_pkg_mgr }} name=tito state=present"
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py
index 17196a813..fd2cd7fbd 100644
--- a/utils/src/ooinstall/openshift_ansible.py
+++ b/utils/src/ooinstall/openshift_ansible.py
@@ -157,9 +157,15 @@ def load_system_facts(inventory_file, os_facts_path, env_vars, verbose=False):
status = subprocess.call(args, env=env_vars, stdout=FNULL)
if not status == 0:
return [], 1
- callback_facts_file = open(CFG.settings['ansible_callback_facts_yaml'], 'r')
- callback_facts = yaml.load(callback_facts_file)
- callback_facts_file.close()
+
+ with open(CFG.settings['ansible_callback_facts_yaml'], 'r') as callback_facts_file:
+ try:
+ callback_facts = yaml.safe_load(callback_facts_file)
+ except yaml.YAMLError, exc:
+ print "Error in {}".format(CFG.settings['ansible_callback_facts_yaml']), exc
+ print "Try deleting and rerunning the atomic-openshift-installer"
+ sys.exit(1)
+
return callback_facts, 0