Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
inmanturbo committed Jan 12, 2021
1 parent 5932a70 commit 42cde65
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
18 changes: 18 additions & 0 deletions local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,28 @@
ignore_errors: yes
- debug: msg="{{ is_docker_installed.rc }}" # it returns rc 1
- debug: var=is_docker_installed

- name: update repos (Alpine)
when: ansible_distribution in ["Alpine"]
apk:
update_cache: yes
changed_when: False
- name: Check is docker installed
shell: command -v docker >/dev/null 2>&1
register: is_docker_installed
ignore_errors: yes
- debug: msg="{{ is_docker_installed.rc }}" # it returns rc 1
- debug: var=is_docker_installed


tasks:
- include: tasks/packages.yml
- include: tasks/users.yml
- include: tasks/cron.yml
- include: tasks/scripts.yml

post_tasks:
- name: commit changes
when: ansible_distribution in ["Alpine"]
shell: sudo lbu commit

2 changes: 1 addition & 1 deletion scripts/rancher_launch.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
#!/bin/sh
docker run -d --restart=unless-stopped -p 3737:80 -p 3783:443 --privileged -v /opt/rancher:/var/lib/rancher --name=rancher_docker_server rancher/rancher:latest
47 changes: 46 additions & 1 deletion tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Install packages
- name: Install packages (debs)
when: ansible_distribution in ["Debian", "Ubuntu"]
apt:
name:
Expand All @@ -23,3 +23,48 @@
- net-tools
- nfs-common

- name: Install libvirt (apks)
when: ansible_distribution in ["Alpine"]
apk:
name: libvirt-daemon
state: present

- name: libvirt is running
when: ansible_distribution in ["Alpine"]
service:
name: libvirtd
enabled: yes
state: started

- name: Install nfs-utils (apks)
when: ansible_distribution in ["Alpine"]
apk:
name: nfs-utils
state: present

- name: nfs-client is running
when: ansible_distribution in ["Alpine"]
service:
name: nfsmount
enabled: yes
state: started

- name: Install qemu (apks)
when: ansible_distribution in ["Alpine"]
apk:
name: qemu-img
state: present

- name: Install qemu-sys (apks)
when: ansible_distribution in ["Alpine"]
apk:
name: qemu-system-x86_64
state: present

- name: Install util-linux (apks)
when: ansible_distribution in ["Alpine"]
apk:
name: util-linux
state: present


2 changes: 1 addition & 1 deletion tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
group: root
mode: 0440

- name: create ansible user
- name: create inman user
user:
name: inman
system: yes
Expand Down

0 comments on commit 42cde65

Please sign in to comment.