test2
5 years ago
5 changed files with 113 additions and 1 deletions
@ -1,2 +1,78 @@ |
|||
# examples-os2 |
|||
# Linux Operating System |
|||
|
|||
Instances of Ubuntu with Linux-based tools |
|||
|
|||
## LabInstance os2 |
|||
|
|||
|
|||
![alt text](images/swarmlab-network.png "") |
|||
|
|||
|
|||
|
|||
|
|||
[inspired by NLKNguyen](https://github.com/NLKNguyen/alpine-mpich) |
|||
|
|||
|
|||
## Quickstart |
|||
|
|||
This is a quickstart guide of howto use this *Lab* |
|||
|
|||
|
|||
|
|||
### Default Configuration |
|||
|
|||
- Working Directory |
|||
|
|||
> /home/ubuntu |
|||
|
|||
- Default user |
|||
|
|||
> ubuntu |
|||
|
|||
|
|||
- Publish yoy work |
|||
|
|||
--- |
|||
**INFO** |
|||
|
|||
|
|||
Usage: |
|||
|
|||
> |
|||
> mkdir /home/ubuntu/directory |
|||
> put you files in that directory |
|||
> swarmlab-publish /home/ubuntu/directory |
|||
> open URL in Browser |
|||
> |
|||
|
|||
--- |
|||
|
|||
|
|||
- The host file that contains addresses of connected workers can be created with: |
|||
|
|||
> |
|||
> swarmlab-getworkers > /home/ubuntu/invhosts |
|||
> |
|||
|
|||
- connect to workers |
|||
|
|||
> |
|||
> ssh ubuntu@[IP] |
|||
> user has sudo rights |
|||
> |
|||
|
|||
|
|||
- connect to workers with ansible |
|||
|
|||
```bash |
|||
cd /home/ubuntu/project/examples-os2/ansible |
|||
make ps |
|||
``` |
|||
--- |
|||
|
|||
|
|||
--- |
|||
**MORE INFO** |
|||
|
|||
See http://docs.swarmlab.io/SwarmLab-HowTos/labs/os2/index.adoc.html |
|||
--- |
|||
|
@ -0,0 +1,15 @@ |
|||
all: ps |
|||
|
|||
# current full path
|
|||
DIR:=$(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) |
|||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) |
|||
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) |
|||
|
|||
ps: |
|||
@echo "ps aux" ; \
|
|||
cat inv-template.yml > inv.yml ; \
|
|||
swarmlab-getworkers >> inv.yml ; \
|
|||
ansible-playbook -u ubuntu -inv.yml examples/ps.yml -f 5 --private-key=/home/ubuntu/.ssh/id_rsa ; \
|
|||
|
|||
|
|||
|
@ -0,0 +1,20 @@ |
|||
--- |
|||
- hosts: service |
|||
remote_user: ubuntu |
|||
vars: |
|||
user: "ubuntu" |
|||
|
|||
tasks: |
|||
|
|||
|
|||
- name: ps |
|||
become: yes |
|||
become_user: "{{ user }}" |
|||
command: ps aux |
|||
ignore_errors: yes |
|||
register: o |
|||
|
|||
|
|||
- name: ls o |
|||
debug: var=o.stdout_lines |
|||
|
@ -0,0 +1 @@ |
|||
[service] |
After Width: | Height: | Size: 80 KiB |
Loading…
Reference in new issue