master
Andrew Wang 1 year ago
parent 895d9e3251
commit a2cf067060
  1. 2
      libvirt/README.md
  2. 4
      mirror/README.md
  3. 37
      mirror/main.yml
  4. 8
      roles/mirror/tasks/main.yml
  5. BIN
      roles/mirror/templates/root/merlin/busybox

@ -28,7 +28,7 @@ $ pacman -S qemu libvirt virt-install virt-viewer ansible
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
```

@ -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

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

Loading…
Cancel
Save