Skip to content

Commit

Permalink
Relocate filter plugins to lib_utils
Browse files Browse the repository at this point in the history
This commit relocates filter_plugings to lib_utils,
changes the namespacing to prevent unintended use of
older versions that may be present in filter_plugins/
directory on existing installs.

Add lib_utils to meta depends for roles

Also consolidate some plugins into lib_utils from
various other areas.

Update rpm spec, obsolete plugin rpms.
  • Loading branch information
michaelgugino committed Dec 18, 2017
1 parent b713000 commit 7bf621c
Show file tree
Hide file tree
Showing 161 changed files with 332 additions and 896 deletions.
4 changes: 0 additions & 4 deletions ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#log_path = /tmp/ansible.log

# Additional default options for OpenShift Ansible
callback_plugins = callback_plugins/
filter_plugins = filter_plugins/
lookup_plugins = lookup_plugins/
library = library/
forks = 20
host_key_checking = False
retry_files_enabled = False
Expand Down
69 changes: 0 additions & 69 deletions filter_plugins/openshift_version.py

This file was deleted.

1 change: 0 additions & 1 deletion lookup_plugins/README.md

This file was deleted.

89 changes: 3 additions & 86 deletions openshift-ansible.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ Requires: tar
Requires: %{name}-docs = %{version}-%{release}
Requires: %{name}-playbooks = %{version}-%{release}
Requires: %{name}-roles = %{version}-%{release}
Requires: %{name}-filter-plugins = %{version}-%{release}
Requires: %{name}-lookup-plugins = %{version}-%{release}
Requires: %{name}-callback-plugins = %{version}-%{release}
Requires: java-1.8.0-openjdk-headless
Requires: httpd-tools
Requires: libselinux-python
Expand All @@ -52,8 +49,6 @@ popd
# Base openshift-ansible install
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_datadir}/ansible/%{name}
mkdir -p %{buildroot}%{_datadir}/ansible_plugins
cp -rp library %{buildroot}%{_datadir}/ansible/%{name}/

# openshift-ansible-bin install
mkdir -p %{buildroot}%{_bindir}
Expand Down Expand Up @@ -88,31 +83,6 @@ rm -rf %{buildroot}%{_datadir}/ansible/%{name}/roles/contiv/*
# touch a file in contiv so that it can be added to SCM's
touch %{buildroot}%{_datadir}/ansible/%{name}/roles/contiv/.empty_dir

# openshift_master_facts symlinks filter_plugins/oo_filters.py from ansible_plugins/filter_plugins
pushd %{buildroot}%{_datadir}/ansible/%{name}/roles/openshift_master_facts/filter_plugins
ln -sf ../../../../../ansible_plugins/filter_plugins/oo_filters.py oo_filters.py
popd

# openshift-ansible-filter-plugins install
cp -rp filter_plugins %{buildroot}%{_datadir}/ansible_plugins/

# openshift-ansible-lookup-plugins install
cp -rp lookup_plugins %{buildroot}%{_datadir}/ansible_plugins/

# openshift-ansible-callback-plugins install
cp -rp callback_plugins %{buildroot}%{_datadir}/ansible_plugins/

# create symlinks from /usr/share/ansible/plugins/lookup ->
# /usr/share/ansible_plugins/lookup_plugins
pushd %{buildroot}%{_datadir}
mkdir -p ansible/plugins
pushd ansible/plugins
ln -s ../../ansible_plugins/lookup_plugins lookup
ln -s ../../ansible_plugins/filter_plugins filter
ln -s ../../ansible_plugins/callback_plugins callback
popd
popd

# atomic-openshift-utils install
pushd utils
%{__python} setup.py install --skip-build --root %{buildroot}
Expand All @@ -131,7 +101,6 @@ popd
%license LICENSE
%dir %{_datadir}/ansible/%{name}
%{_datadir}/ansible/%{name}/files
%{_datadir}/ansible/%{name}/library
%ghost %{_datadir}/ansible/%{name}/playbooks/common/openshift-master/library.rpmmoved

# ----------------------------------------------------------------------------------
Expand All @@ -155,9 +124,6 @@ BuildArch: noarch
Summary: Openshift and Atomic Enterprise Ansible Playbooks
Requires: %{name} = %{version}-%{release}
Requires: %{name}-roles = %{version}-%{release}
Requires: %{name}-lookup-plugins = %{version}-%{release}
Requires: %{name}-filter-plugins = %{version}-%{release}
Requires: %{name}-callback-plugins = %{version}-%{release}
BuildArch: noarch

%description playbooks
Expand Down Expand Up @@ -198,9 +164,9 @@ end
# ----------------------------------------------------------------------------------
Summary: Openshift and Atomic Enterprise Ansible roles
Requires: %{name} = %{version}-%{release}
Requires: %{name}-lookup-plugins = %{version}-%{release}
Requires: %{name}-filter-plugins = %{version}-%{release}
Requires: %{name}-callback-plugins = %{version}-%{release}
Obsoletes: %{name}-lookup-plugins
Obsoletes: %{name}-filter-plugins
Obsoletes: %{name}-callback-plugins
BuildArch: noarch

%description roles
Expand All @@ -209,55 +175,6 @@ BuildArch: noarch
%files roles
%{_datadir}/ansible/%{name}/roles


# ----------------------------------------------------------------------------------
# openshift-ansible-filter-plugins subpackage
# ----------------------------------------------------------------------------------
%package filter-plugins
Summary: Openshift and Atomic Enterprise Ansible filter plugins
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
Requires: pyOpenSSL

%description filter-plugins
%{summary}.

%files filter-plugins
%{_datadir}/ansible_plugins/filter_plugins
%{_datadir}/ansible/plugins/filter


# ----------------------------------------------------------------------------------
# openshift-ansible-lookup-plugins subpackage
# ----------------------------------------------------------------------------------
%package lookup-plugins
Summary: Openshift and Atomic Enterprise Ansible lookup plugins
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description lookup-plugins
%{summary}.

%files lookup-plugins
%{_datadir}/ansible_plugins/lookup_plugins
%{_datadir}/ansible/plugins/lookup


# ----------------------------------------------------------------------------------
# openshift-ansible-callback-plugins subpackage
# ----------------------------------------------------------------------------------
%package callback-plugins
Summary: Openshift and Atomic Enterprise Ansible callback plugins
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description callback-plugins
%{summary}.

%files callback-plugins
%{_datadir}/ansible_plugins/callback_plugins
%{_datadir}/ansible/plugins/callback

# ----------------------------------------------------------------------------------
# atomic-openshift-utils subpackage
# ----------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion playbooks/aws/openshift-cluster/filter_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/aws/openshift-cluster/lookup_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/byo/filter_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/byo/lookup_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/byo/openshift-cluster/filter_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/byo/openshift-cluster/lookup_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/common/openshift-cluster/filter_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/common/openshift-cluster/library

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/common/openshift-cluster/lookup_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/common/openshift-cluster/upgrades/filter_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/common/openshift-cluster/upgrades/lookup_plugins

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

- set_fact:
haproxy_routers: "{{ all_routers.results.results[0]['items'] |
oo_pods_match_component(openshift_deployment_type, 'haproxy-router') |
oo_select_keys_from_list(['metadata']) }}"
lib_utils_oo_pods_match_component(openshift_deployment_type, 'haproxy-router') |
lib_utils_oo_select_keys_from_list(['metadata']) }}"
when:
- all_routers.results.returncode == 0

Expand Down
4 changes: 2 additions & 2 deletions playbooks/common/openshift-cluster/upgrades/pre/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
hosts: "{{ l_upgrade_no_proxy_hosts }}"
tasks:
- set_fact:
openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
openshift_no_proxy_internal_hostnames: "{{ hostvars | lib_utils_oo_select_keys(groups['oo_nodes_to_config']
| union(groups['oo_masters_to_config'])
| union(groups['oo_etcd_to_config'] | default([])))
| oo_collect('openshift.common.hostname') | default([]) | join (',')
| lib_utils_oo_collect('openshift.common.hostname') | default([]) | join (',')
}}"
when:
- openshift_http_proxy is defined or openshift_https_proxy is defined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
tasks:
- set_fact:
master_update_completed: "{{ hostvars
| oo_select_keys(groups.oo_masters_to_config)
| oo_collect('inventory_hostname', {'master_update_complete': true}) }}"
| lib_utils_oo_select_keys(groups.oo_masters_to_config)
| lib_utils_oo_collect('inventory_hostname', {'master_update_complete': true}) }}"
- set_fact:
master_update_failed: "{{ groups.oo_masters_to_config | difference(master_update_completed) | list }}"
- fail:
Expand Down Expand Up @@ -246,8 +246,8 @@
tasks:
- set_fact:
reconcile_completed: "{{ hostvars
| oo_select_keys(groups.oo_masters_to_config)
| oo_collect('inventory_hostname', {'reconcile_complete': true}) }}"
| lib_utils_oo_select_keys(groups.oo_masters_to_config)
| lib_utils_oo_collect('inventory_hostname', {'reconcile_complete': true}) }}"
- set_fact:
reconcile_failed: "{{ groups.oo_masters_to_config | difference(reconcile_completed) | list }}"
- fail:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions playbooks/init/facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@
openshift_facts:
role: common
local_facts:
no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
no_proxy_internal_hostnames: "{{ hostvars | lib_utils_oo_select_keys(groups['oo_nodes_to_config']
| union(groups['oo_masters_to_config'])
| union(groups['oo_etcd_to_config'] | default([])))
| oo_collect('openshift.common.hostname') | default([]) | join (',')
| lib_utils_oo_collect('openshift.common.hostname') | default([]) | join (',')
}}"
when:
- openshift_http_proxy is defined or openshift_https_proxy is defined
Expand Down
1 change: 0 additions & 1 deletion playbooks/openshift-etcd/private/filter_plugins

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/openshift-etcd/private/lookup_plugins

This file was deleted.

8 changes: 4 additions & 4 deletions playbooks/openshift-etcd/private/migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
tasks:
- set_fact:
etcd_backup_completed: "{{ hostvars
| oo_select_keys(groups.oo_etcd_to_migrate)
| oo_collect('inventory_hostname', {'r_etcd_common_backup_complete': true}) }}"
| lib_utils_oo_select_keys(groups.oo_etcd_to_migrate)
| lib_utils_oo_collect('inventory_hostname', {'r_etcd_common_backup_complete': true}) }}"
- set_fact:
etcd_backup_failed: "{{ groups.oo_etcd_to_migrate | difference(etcd_backup_completed) | list }}"
- fail:
Expand Down Expand Up @@ -118,8 +118,8 @@
tasks:
- set_fact:
etcd_migration_completed: "{{ hostvars
| oo_select_keys(groups.oo_etcd_to_migrate)
| oo_collect('inventory_hostname', {'r_etcd_migrate_success': true}) }}"
| lib_utils_oo_select_keys(groups.oo_etcd_to_migrate)
| lib_utils_oo_collect('inventory_hostname', {'r_etcd_migrate_success': true}) }}"
- set_fact:
etcd_migration_failed: "{{ groups.oo_etcd_to_migrate | difference(etcd_migration_completed) | list }}"

Expand Down
24 changes: 12 additions & 12 deletions playbooks/openshift-etcd/private/redeploy-ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
- import_playbook: restart.yml
# Do not restart etcd when etcd certificates were previously expired.
when: ('expired' not in (hostvars
| oo_select_keys(groups['etcd'])
| oo_collect('check_results.check_results.etcd')
| oo_collect('health')))
| lib_utils_oo_select_keys(groups['etcd'])
| lib_utils_oo_collect('check_results.check_results.etcd')
| lib_utils_oo_collect('health')))

- name: Retrieve etcd CA certificate
hosts: oo_first_etcd
Expand Down Expand Up @@ -87,15 +87,15 @@
when:
# masters
- ('expired' not in hostvars
| oo_select_keys(groups['oo_masters_to_config'])
| oo_collect('check_results.check_results.ocp_certs')
| oo_collect('health', {'path':hostvars[groups.oo_first_master.0].openshift.common.config_base ~ "/master/master.server.crt"}))
| lib_utils_oo_select_keys(groups['oo_masters_to_config'])
| lib_utils_oo_collect('check_results.check_results.ocp_certs')
| lib_utils_oo_collect('health', {'path':hostvars[groups.oo_first_master.0].openshift.common.config_base ~ "/master/master.server.crt"}))
- ('expired' not in hostvars
| oo_select_keys(groups['oo_masters_to_config'])
| oo_collect('check_results.check_results.ocp_certs')
| oo_collect('health', {'path':hostvars[groups.oo_first_master.0].openshift.common.config_base ~ "/master/ca-bundle.crt"}))
| lib_utils_oo_select_keys(groups['oo_masters_to_config'])
| lib_utils_oo_collect('check_results.check_results.ocp_certs')
| lib_utils_oo_collect('health', {'path':hostvars[groups.oo_first_master.0].openshift.common.config_base ~ "/master/ca-bundle.crt"}))
# etcd
- ('expired' not in (hostvars
| oo_select_keys(groups['etcd'])
| oo_collect('check_results.check_results.etcd')
| oo_collect('health')))
| lib_utils_oo_select_keys(groups['etcd'])
| lib_utils_oo_collect('check_results.check_results.etcd')
| lib_utils_oo_collect('health')))
Loading

0 comments on commit 7bf621c

Please sign in to comment.