parent
895d9e3251
commit
a2cf067060
@ -1,5 +1,7 @@ |
||||
# Mirror Playbook |
||||
This playbook will be run inside a vm to set up the mirror's services |
||||
**DO NOT run this on your host machine!** |
||||
|
||||
This playbook as root **inside** the vm to set up the mirror's services |
||||
``` |
||||
ansible-playbook main.yml |
||||
``` |
@ -1,10 +1,33 @@ |
||||
- name: setup mirror vm |
||||
hosts: 127.0.0.1 |
||||
gather_facts: no |
||||
roles: |
||||
- "../roles/system" |
||||
- "../roles/mirror" |
||||
- "../roles/ftp" |
||||
- "../roles/nginx" |
||||
- "../roles/rsync" |
||||
- "../roles/ssh" |
||||
tasks: |
||||
- name: get hostname |
||||
command: "hostname" |
||||
changed_when: false |
||||
ignore_errors: true |
||||
register: hostname |
||||
|
||||
- name: fail when hostname is not mirror |
||||
fail: |
||||
msg: DO NOT run this on your host machine! |
||||
when: hostname.stdout != "mirror" |
||||
|
||||
- name: run the system role first |
||||
include_role: |
||||
name: "../roles/system" |
||||
|
||||
- name: run mirror system role second |
||||
include_role: |
||||
name: "../roles/mirror" |
||||
|
||||
- name: run the rest of the roles |
||||
include_role: |
||||
name: "{{ roleinputvar }}" |
||||
loop: |
||||
- "../roles/ftp" |
||||
- "../roles/nginx" |
||||
- "../roles/rsync" |
||||
- "../roles/ssh" |
||||
loop_control: |
||||
loop_var: roleinputvar |
||||
|
Binary file not shown.
Loading…
Reference in new issue