From 5f04bae550dbc6e34283be9273324cd17fe1c35a Mon Sep 17 00:00:00 2001 From: lefos Date: Tue, 26 Oct 2021 21:10:01 +0300 Subject: [PATCH] asd --- ddocker.sh | 5 - monitorall.yml | 43 +++ monitorall.yml.sh | 24 ++ test.vue | 658 ---------------------------------------------- 4 files changed, 67 insertions(+), 663 deletions(-) delete mode 100755 ddocker.sh create mode 100644 monitorall.yml create mode 100644 monitorall.yml.sh delete mode 100644 test.vue diff --git a/ddocker.sh b/ddocker.sh deleted file mode 100755 index 8a2bb67..0000000 --- a/ddocker.sh +++ /dev/null @@ -1,5 +0,0 @@ -sudo rm -rf /var/lib/docker /etc/docker -sudo rm /etc/apparmor.d/docker -sudo groupdel docker -sudo rm -rf /var/run/docker.sock -sudo rm -rf /usr/local/bin/docker-compose \ No newline at end of file diff --git a/monitorall.yml b/monitorall.yml new file mode 100644 index 0000000..26e2aef --- /dev/null +++ b/monitorall.yml @@ -0,0 +1,43 @@ +-- +- hosts: service + remote_user: docker + gather_facts: no + vars: + user: "docker" + + tasks: + + # ------------------------ + # apt update + # ------------------------- + - name: apt update packages + become: true + apt: + update_cache: 'yes' + force_apt_get: 'yes' + upgrade: 'dist' + cache_valid_time: 3600 + install_recommends: true + autoremove: true + # ------------------------ + # apt install packages + # ------------------------- + - name: apt install packages + become: true + apt: + update_cache: 'yes' + force_apt_get: 'yes' + install_recommends: true + autoremove: true + name: "{{ packages }}" + vars: + packages: + - build-essential + - git + - flex + - bison + - traceroute + - curl + - lynx + - ruby + - ruby-dev \ No newline at end of file diff --git a/monitorall.yml.sh b/monitorall.yml.sh new file mode 100644 index 0000000..c34ed27 --- /dev/null +++ b/monitorall.yml.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +sudo apt update -y +sudo apt install -y ansible sshpass + +sudo mkdir -p /home/docker/.ansible +sudo chown docker.docker -R /home/docker + +sudo cp files/ansible.cfg /etc/ansible/ansible.cfg + +ip4=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) +ip6=$(/sbin/ip -o -6 addr list eth0 | awk '{print $4}' | cut -d/ -f1) + +echo "[service]" > /project/courses/fluentd/inventory.yml +/project/bin/swarmlab-nmap >> /project/courses/fluentd/inventory.yml + + +# include master or not +echo $ip4 >> /project/courses/fluentd/inventory.yml + +ansible-playbook -u docker -i inventory.yml fluentd.yml -f 5 --ask-pass --ask-become-pass +# 1st make sudo without password +# run with keys +#ansible-playbook -u docker -i inventory.yml fluentd.yml -f 5 --private-key=/home/docker/.ssh/id_rsa \ No newline at end of file diff --git a/test.vue b/test.vue deleted file mode 100644 index af14e5c..0000000 --- a/test.vue +++ /dev/null @@ -1,658 +0,0 @@ - - - \ No newline at end of file