Skip to content

Commit

Permalink
Automatic regen for new roles
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Arrotin <[email protected]>
  • Loading branch information
arrfab committed Jan 12, 2023
1 parent 36f332c commit 0200757
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adhoc-node-pdns-modify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
shell:
cmd: /var/lib/centos-infra/host-modify -a "{{ pdns_action }}" -n "{{ target }}"
chdir: /var/lib/centos-infra
delegate_to: "{{ zabbix_api_srv }}"
delegate_to: "{{ pdns_db_host }}"

- name: Reloading directly powerdns zone on pdns nodes
command:
Expand Down
4 changes: 4 additions & 0 deletions adhoc-ocp-deploy-jenkins-for-ci-tenant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
tasks:
- set_fact:
mgmt_hosts: "{{ ocp_groups[ocp_env] }}"
tags:
- vars
- add_host:
name: "{{ item }}"
groups: ocp_target_host
with_items: "{{ groups[mgmt_hosts] }}"
tags:
- vars

- hosts: ocp_target_host
become: true
Expand Down
3 changes: 3 additions & 0 deletions requirements-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ roles:
- src: https://github.com/CentOS/ansible-role-gitea
name: gitea
version: master
- src: https://github.com/CentOS/ansible-role-gitlab-runner
name: gitlab-runner
version: master
- src: https://github.com/CentOS/ansible-role-haproxy
name: haproxy
version: master
Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ roles:
- src: https://github.com/CentOS/ansible-role-gitea
name: gitea
version: staging
- src: https://github.com/CentOS/ansible-role-gitlab-runner
name: gitlab-runner
version: staging
- src: https://github.com/CentOS/ansible-role-haproxy
name: haproxy
version: staging
Expand Down
3 changes: 3 additions & 0 deletions requirements-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ roles:
- src: https://github.com/CentOS/ansible-role-gitea
name: gitea
version: master
- src: https://github.com/CentOS/ansible-role-gitlab-runner
name: gitlab-runner
version: master
- src: https://github.com/CentOS/ansible-role-haproxy
name: haproxy
version: master
Expand Down
3 changes: 3 additions & 0 deletions requirements-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ roles:
- src: https://github.com/CentOS/ansible-role-gitea
name: gitea
version: staging
- src: https://github.com/CentOS/ansible-role-gitlab-runner
name: gitlab-runner
version: staging
- src: https://github.com/CentOS/ansible-role-haproxy
name: haproxy
version: staging
Expand Down
1 change: 1 addition & 0 deletions role-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- import_playbook: role-fedora-messaging-client.yml
- import_playbook: role-geoip2.yml
- import_playbook: role-gitea.yml
- import_playbook: role-gitlab-runner.yml
- import_playbook: role-haproxy.yml
- import_playbook: role-httpd.yml
- import_playbook: role-httpd-compose.yml
Expand Down
24 changes: 24 additions & 0 deletions role-gitlab-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- hosts: hostgroup-role-gitlab-runner
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:
- gitlab-runner

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

10 changes: 7 additions & 3 deletions templates/ansible-hostvars.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ macaddress: {{ ansible_default_ipv4.macaddress | default('')}}
dns:
{% for ns in ansible_dns.nameservers %}
- {{ ns }}
{% endfor %}
{%- endfor %}

hardware_vendor: {{ ansible_system_vendor }}
product_name: {{ ansible_product_name }}
serial_number: {{ ansible_product_serial }}

{% if ansible_bios_vendor == 'Amazon EC2' %}
aws_ec2_instance_id:
aws_ec2_region:
{% else %}
root_password:

sponsor_name:
Expand All @@ -33,6 +37,6 @@ sponsor_portal:
- user:
- password:
sponsor_contacts: []
{% endif %}


aws_ec2_instance_id:
aws_ec2_region:

0 comments on commit 0200757

Please sign in to comment.