mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-16 13:56:03 +08:00
255 lines
8.2 KiB
YAML
255 lines
8.2 KiB
YAML
# This is a basic playbook
|
|
|
|
- name: dole out the basic configuration
|
|
hosts: nfs_servers
|
|
user: root
|
|
gather_facts: True
|
|
|
|
vars_files:
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
- "/srv/private/ansible/vars.yml"
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
|
|
pre_tasks:
|
|
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
|
|
|
|
roles:
|
|
- base
|
|
- rkhunter
|
|
- hosts
|
|
- fas_client
|
|
- nagios_client
|
|
- collectd/base
|
|
- sudo
|
|
|
|
tasks:
|
|
- import_tasks: "{{ tasks_path }}/2fa_client.yml"
|
|
- import_tasks: "{{ tasks_path }}/motd.yml"
|
|
|
|
handlers:
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
|
|
|
## This should be in a different playbook.
|
|
- name: Deal with drive items on storinator01
|
|
hosts: storinator01.fedorainfracloud.org
|
|
user: root
|
|
gather_facts: True
|
|
vars_files:
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
- "/srv/private/ansible/vars.yml"
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
handlers:
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
|
|
|
tasks:
|
|
- name: Create top level directory
|
|
file: path=/srv/nfs state=directory owner=root group=root
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: create copr-dist-git storage
|
|
lvol: vg=VG_nfs lv=copr-dist-git size=10t shrink=no
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Create FS for copr-dist-git
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/copr-dist-git
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Create copr-dist-git tree directory
|
|
file: path=/srv/nfs/copr-dist-git state=directory owner=root group=root
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Mount copr-dist-git tree directory
|
|
mount: name=/srv/nfs/copr-dist-git src=/dev/mapper/VG_nfs-copr--dist--git fstype=xfs state=mounted
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: create dev copr-dist-git-dev storage
|
|
lvol: vg=VG_nfs lv=copr-dist-git-dev size=1t shrink=no
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Create FS for dev copr-dist-git-dev
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/copr-dist-git-dev
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Create dev copr-dist-git tree directory
|
|
file: path=/srv/nfs/copr-dist-git-dev state=directory owner=root group=root
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Mount dev copr-dist-git tree directory
|
|
mount: name=/srv/nfs/copr-dist-git-dev src=/dev/mapper/VG_nfs-copr--dist--git--dev fstype=xfs state=mounted
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: create copr-be storage
|
|
lvol: vg=VG_nfs lv=copr-be size=20t shrink=no
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Create FS for copr-be
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/copr-be
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Create copr-be tree directory
|
|
file: path=/srv/nfs/copr-be state=directory owner=root group=root
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: Mount copr-be tree directory
|
|
mount: name=/srv/nfs/copr-be src=/dev/mapper/VG_nfs-copr--be fstype=xfs state=mounted
|
|
tags:
|
|
- drives
|
|
- copr
|
|
|
|
- name: create 1 GB communishift logical volumes
|
|
lvol: vg=VG_nfs lv=openshift-01gb-{{item}} size=1g shrink=no
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create FS for 1 GB communishift logical volules
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/openshift-01gb-{{item}}
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create openshift 1GB tree directories
|
|
file: path=/srv/nfs/openshift-01gb-{{item}} state=directory owner=root group=root
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Mount openshift 1GB tree directories
|
|
mount: name=/srv/nfs/openshift-01gb-{{item}} src=/dev/mapper/VG_nfs-openshift--01gb--{{item}} fstype=xfs state=mounted
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: create 5 GB communishift logical volumes
|
|
lvol: vg=VG_nfs lv=openshift-05gb-{{item}} size=5g shrink=no
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create FS for 5 GB communishift logical volules
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/openshift-05gb-{{item}}
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create openshift 5GB tree directories
|
|
file: path=/srv/nfs/openshift-05gb-{{item}} state=directory owner=root group=root
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Mount openshift 5GB tree directories
|
|
mount: name=/srv/nfs/openshift-05gb-{{item}} src=/dev/mapper/VG_nfs-openshift--05gb--{{item}} fstype=xfs state=mounted
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: create 10 GB communishift logical volumes
|
|
lvol: vg=VG_nfs lv=openshift-10gb-{{item}} size=10g shrink=no
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create FS for 10 GB communishift logical volules
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/openshift-10gb-{{item}}
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create openshift 10GB tree directories
|
|
file: path=/srv/nfs/openshift-10gb-{{item}} state=directory owner=root group=root
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Mount openshift 10GB tree directories
|
|
mount: name=/srv/nfs/openshift-10gb-{{item}} src=/dev/mapper/VG_nfs-openshift--10gb--{{item}} fstype=xfs state=mounted
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: create 25 GB communishift logical volumes
|
|
lvol: vg=VG_nfs lv=openshift-25gb-{{item}} size=25g shrink=no
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create FS for 25 GB communishift logical volules
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/openshift-25gb-{{item}}
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create openshift 25GB tree directories
|
|
file: path=/srv/nfs/openshift-25gb-{{item}} state=directory owner=root group=root
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Mount openshift 25GB tree directories
|
|
mount: name=/srv/nfs/openshift-25gb-{{item}} src=/dev/mapper/VG_nfs-openshift--25gb--{{item}} fstype=xfs state=mounted
|
|
with_items: ["00","01","02","03","04","05","06","07","08","09"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: create 100 GB communishift logical volumes
|
|
lvol: vg=VG_nfs lv=openshift-100gb-{{item}} size=100g shrink=no
|
|
with_items: ["00","01"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create FS for 100 GB communishift logical volules
|
|
filesystem: fstype=xfs dev=/dev/VG_nfs/openshift-100gb-{{item}}
|
|
with_items: ["00","01"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Create openshift 100GB tree directories
|
|
file: path=/srv/nfs/openshift-100gb-{{item}} state=directory owner=root group=root
|
|
with_items: ["00","01"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Mount openshift 100GB tree directories
|
|
mount: name=/srv/nfs/openshift-100gb-{{item}} src=/dev/mapper/VG_nfs-openshift--100gb--{{item}} fstype=xfs state=mounted
|
|
with_items: ["00","01"]
|
|
tags:
|
|
- drives
|
|
|
|
- name: Deal with NFS
|
|
hosts: storinator01.fedorainfracloud.org
|
|
user: root
|
|
gather_facts: True
|
|
vars_files:
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
- "/srv/private/ansible/vars.yml"
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
handlers:
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
|
roles:
|
|
- nfs/server
|