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

Adding playbook for ODCS deployment #10

Merged
merged 2 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 6 additions & 0 deletions requirements-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
- src: https://github.com/CentOS/ansible-role-ocp-admin-node
name: ocp-admin-node
version: staging
- src: https://github.com/CentOS/ansible-role-odcs-backend
name: odcs-backend
version: staging
- src: https://github.com/CentOS/ansible-role-odcs-frontend
name: odcs-frontend
version: staging
- src: https://github.com/CentOS/ansible-role-opennebula-frontend
name: opennebula-frontend
version: staging
Expand Down
4 changes: 4 additions & 0 deletions requirements-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
name: nfs-server
- src: https://github.com/CentOS/ansible-role-ocp-admin-node
name: ocp-admin-node
- src: https://github.com/CentOS/ansible-role-odcs-backend
name: odcs-backend
- src: https://github.com/CentOS/ansible-role-odcs-frontend
name: odcs-frontend
- src: https://github.com/CentOS/ansible-role-opennebula-frontend
name: opennebula-frontend
- src: https://github.com/CentOS/ansible-role-opennebula-kvm-host
Expand Down
6 changes: 6 additions & 0 deletions requirements-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
- src: https://github.com/CentOS/ansible-role-ocp-admin-node
name: ocp-admin-node
version: staging
- src: https://github.com/CentOS/ansible-role-odcs-backend
name: odcs-backend
version: staging
- src: https://github.com/CentOS/ansible-role-odcs-frontend
name: odcs-frontend
version: staging
- src: https://github.com/CentOS/ansible-role-opennebula-frontend
name: opennebula-frontend
version: staging
Expand Down
2 changes: 2 additions & 0 deletions role-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
- import_playbook: role-mysql.yml
- import_playbook: role-nfs-server.yml
- import_playbook: role-ocp-admin-node.yml
- import_playbook: role-odcs-backend.yml
- import_playbook: role-odcs-frontend.yml
- import_playbook: role-opennebula-frontend.yml
- import_playbook: role-opennebula-kvm-host.yml
- import_playbook: role-opentracker.yml
Expand Down
49 changes: 49 additions & 0 deletions role-odcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
- name: Setup ODCS frontend
Copy link
Member

@arrfab arrfab Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have role-odcs-frontend.yml and role-odcs-backend.yml, themselves calling corresponding role ? Just to keep the logic we use so far, as automated ansible deploy will try to ensure each git repo/role is up2date before kicking ansible-playbook for the role

And BTW, that's how it's declared in role-all.yml : two different playbooks, so they should exist and the role-odcs.yml deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @arrfab, I fixed it

hosts: hostgroup-role-odcs-frontend
become: True
pre_tasks:
- name: Checking if no-ansible file is there
stat:
path: /etc/no-ansible
register: no_ansible

- name: Verifying if we can run ansible or not
assert:
that:
- "not no_ansible.stat.exists"
msg: "/etc/no-ansible file exists so skipping ansible run on this node"

roles:
- odcs-frontend

post_tasks:
- name: Touching ansible-run (monitored by Zabbix)
file:
path: /var/log/ansible.run
state: touch


- name: Setup ODCS backend
hosts: hostgroup-role-odcs-backend
become: True
pre_tasks:
- name: Checking if no-ansible file is there
stat:
path: /etc/no-ansible
register: no_ansible

- name: Verifying if we can run ansible or not
assert:
that:
- "not no_ansible.stat.exists"
msg: "/etc/no-ansible file exists so skipping ansible run on this node"

roles:
- odcs-backend

post_tasks:
- name: Touching ansible-run (monitored by Zabbix)
file:
path: /var/log/ansible.run
state: touch