Skip to content
Open
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
14 changes: 9 additions & 5 deletions .github/workflows/.ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: ansible_collections/hpe/oneview

- name: Lint Ansible Playbook
uses: ansible/ansible-lint-action@main
with:
path: "./"
- name: Install ansible-lint
run: |
pip install ansible ansible-lint

- name: Run ansible-lint
run: |
cd ansible_collections/hpe/oneview
ansible-lint

units:
runs-on: ubuntu-latest
Expand Down
59 changes: 37 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
FROM python:3.9-slim-buster
LABEL maintainer "Chebrolu Harika <[email protected]>"


ARG http_proxy
ARG https_proxy
ARG no_proxy

ENV http_proxy=${http_proxy}
ENV https_proxy=${https_proxy}
ENV no_proxy=${no_proxy}
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /root

# Some optional but recommended packages
RUN DEBAIN_FRONTEND=noninteractive \
apt-get update -y \
&& apt-get install --no-install-recommends -y \
vim \
curl \
&& pip install ansible hpeOneView hpICsp

# Adding hosts for convenience
RUN mkdir -p /etc/ansible
RUN echo [localhost] >> /etc/ansible/hosts
RUN echo localhost ansible_python_interpreter=python3 ansible_connection=local >> /etc/ansible/hosts

RUN apt-get update -y && \
apt-get install --no-install-recommends -y \
vim \
curl \
git \
&& pip install --no-cache-dir ansible hpeOneView hpICsp \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*


RUN mkdir -p /etc/ansible && \
echo "[localhost]" > /etc/ansible/hosts && \
echo "localhost ansible_python_interpreter=python3 ansible_connection=local" >> /etc/ansible/hosts


ADD . oneview-ansible-collection/
WORKDIR /root/oneview-ansible-collection

# Building and Installing hpe.oneview collection
RUN ansible-galaxy collection build --force .
RUN ansible-galaxy collection install *.tar.gz

RUN ansible-galaxy collection build --force . && \
ansible-galaxy collection install *.tar.gz


WORKDIR /root/.ansible/collections/ansible_collections/hpe/oneview

# Clean and remove not required packages
RUN DEBAIN_FRONTEND=noninteractive \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/cache/apt/archives/* /var/cache/apt/lists* /tmp/* /root/cache/.


RUN apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/cache/apt/archives/* /var/cache/apt/lists/* /tmp/* /root/cache/

CMD ["ansible-playbook", "--version"]