Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add k8s inventory plugin for usage as conductor container #18

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Dockerfile-canary
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ RUN git clone https://github.com/ansible/ansible-kubernetes-modules.git /etc/ans

RUN git clone https://github.com/ansibleplaybookbundle/ansible-asb-modules.git /etc/ansible/roles/ansibleplaybookbundle.asb-modules

RUN echo "localhost ansible_connection=local" > /etc/ansible/hosts \
&& echo '[defaults]' > /etc/ansible/ansible.cfg \
&& echo 'roles_path = /opt/ansible/roles' >> /etc/ansible/ansible.cfg \
&& echo 'library = /usr/share/ansible/openshift' >> /etc/ansible/ansible.cfg

COPY files/etc/ansible/* /etc/ansible/
RUN echo 'library = /usr/share/ansible/openshift' >> /etc/ansible/ansible.cfg
COPY files/usr/bin/* /usr/bin/
COPY files/opt/apb/.kube/config /opt/apb/.kube/config

Expand Down
23 changes: 14 additions & 9 deletions apb-base-scripts.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
%define build_timestamp %{nil}
%endif

Name: apb-base-scripts
Version: 1.1.5
Release: 1%{build_timestamp}%{?dist}
Summary: Scripts for the apb-base container image

License: ASL 2.0
URL: https://github.com/fusor/apb-examples
Source0: https://github.com/fusor/apb-examples/archive/%{name}-%{version}.tar.gz
Name: apb-base-scripts
Version: 1.1.5
Release: 1%{build_timestamp}%{?dist}
Summary: Scripts for the apb-base container image

License: ASL 2.0
URL: https://github.com/ansibleplaybookbundle/apb-base
Source0: https://github.com/ansibleplaybookbundle/apb-base/archive/%{name}-%{version}.tar.gz
BuildArch: noarch

%description
Expand All @@ -28,6 +28,9 @@ install -m 755 files/usr/bin/test-retrieval-init %{buildroot}%{_bindir}
install -m 755 files/usr/bin/test-retrieval %{buildroot}%{_bindir}
install -m 755 files/usr/bin/entrypoint.sh %{buildroot}%{_bindir}
install -m 755 files/opt/apb/.kube/config %{buildroot}/opt/apb/.kube/config
install -m 755 files/etc/ansible/ansible.cfg %{buildroot}/etc/ansible/ansible.cfg
install -m 755 files/etc/ansible/hosts %{buildroot}/etc/ansible/hosts
install -m 755 files/etc/ansible/k8s.yml %{buildroot}/etc/ansible/k8s.yml

%files
%doc
Expand All @@ -36,6 +39,9 @@ install -m 755 files/opt/apb/.kube/config %{buildroot}/opt/apb/.kube/config
%{_bindir}/entrypoint.sh
%dir %{_sysconfdir}/apb-secrets
/opt/apb/.kube/config
%{_sysconfdir}/ansible/ansible.cfg
%{_sysconfdir}/ansible/hosts
%{_sysconfdir}/ansible/k8s.yml

%changelog
* Fri Feb 02 2018 David Zager <[email protected]> 1.1.5-1
Expand Down Expand Up @@ -81,4 +87,3 @@ install -m 755 files/opt/apb/.kube/config %{buildroot}/opt/apb/.kube/config

* Fri Aug 18 2017 Jason Montleon <[email protected]> 1.0.1-1
- new package built with tito

4 changes: 4 additions & 0 deletions files/etc/ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[inventory]
enable_plugins = k8s

[defaults]
roles_path = /etc/ansible/roles:/opt/ansible/roles
inventory = /etc/ansible/hosts:/etc/ansible/k8s.yml
4 changes: 4 additions & 0 deletions files/etc/ansible/k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugin: k8s
connections:
namespaces:
- {{ namespace }}