This commit is contained in:
Andrew Wang 2021-10-03 23:39:28 -04:00
parent 895d9e3251
commit a2cf067060
5 changed files with 37 additions and 14 deletions

View File

@ -28,7 +28,7 @@ $ pacman -S qemu libvirt virt-install virt-viewer ansible
Run the playbook from one directory down Run the playbook from one directory down
``` ```
ansible-playbook libvirt/main.yml ansible-playbook -K libvirt/main.yml
``` ```
Then connect to the created vm using virt-viewer Then connect to the created vm using virt-viewer
``` ```

View File

@ -1,5 +1,7 @@
# Mirror Playbook # 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 ansible-playbook main.yml
``` ```

View File

@ -1,10 +1,33 @@
- name: setup mirror vm - name: setup mirror vm
hosts: 127.0.0.1 hosts: 127.0.0.1
gather_facts: no gather_facts: no
roles: tasks:
- "../roles/system" - name: get hostname
- "../roles/mirror" 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/ftp"
- "../roles/nginx" - "../roles/nginx"
- "../roles/rsync" - "../roles/rsync"
- "../roles/ssh" - "../roles/ssh"
loop_control:
loop_var: roleinputvar

View File

@ -42,16 +42,14 @@
- name: copy arthur and busybox into merlin - name: copy arthur and busybox into merlin
copy: copy:
src: "{{ item.src }}" src: "{{ role_path }}/tmeplates/root/merlin/{{ item.file }}"
dest: "/mirror/merlin/{{ item.dest }}" dest: "/mirror/merlin/{{ item.dest }}"
owner: root owner: root
group: root group: root
mode: "0755" mode: "0755"
loop: loop:
- src: "{{ role_path }}/templates/root/merlin/arthur" - { file: "arthur", dest: "arthur" }
dest: "arthur" - { file: "busybox", dest: "bin/busybox" }
- src: "/usr/bin/busybox"
dest: "bin/busybox"
- name: create symlinks from busybox and arthur - name: create symlinks from busybox and arthur
# noqa deprecated-command-syntax # noqa deprecated-command-syntax

Binary file not shown.