Skip to content

Commit

Permalink
Add k8s inventory plugin for usage as conductor container
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
LorbusChris committed Feb 18, 2018
1 parent 66dc56e commit c4bd0d9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
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 }}

0 comments on commit c4bd0d9

Please sign in to comment.