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
  • Loading branch information
LorbusChris committed Feb 5, 2018
1 parent 66dc56e commit 2adf249
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
5 changes: 0 additions & 5 deletions Dockerfile-canary
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ 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/
COPY files/usr/bin/* /usr/bin/
COPY files/opt/apb/.kube/config /opt/apb/.kube/config
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile-latest
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN yum -y install epel-release centos-release-openshift-origin \
&& yum -y install --setopt=tsflags=nodocs origin-clients python-openshift ansible ansible-kubernetes-modules ansible-asb-modules apb-base-scripts \
&& yum clean all

COPY files/etc/ansible/* /etc/ansible/

RUN mkdir -p /usr/share/ansible/openshift \
/etc/ansible /opt/ansible \
${BASE_DIR}/{etc,.kube,.ansible/tmp} \
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile-nightly
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN yum -y install epel-release centos-release-openshift-origin \
&& yum -y install --setopt=tsflags=nodocs origin-clients python-openshift ansible ansible-kubernetes-modules ansible-asb-modules apb-base-scripts \
&& yum clean all

COPY files/etc/ansible/* /etc/ansible/

RUN mkdir -p /usr/share/ansible/openshift \
/etc/ansible /opt/ansible \
${BASE_DIR}/{etc,.kube,.ansible/tmp} \
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

5 changes: 5 additions & 0 deletions files/etc/ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[defaults]
roles_path = /etc/ansible/roles:/opt/ansible/roles
inventory = /etc/ansible/hosts:/etc/ansible/k8s.yml
library = /usr/share/ansible/openshift

[inventory]
enable_plugins = k8s
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 2adf249

Please sign in to comment.