From 4b2bf6cd23dfc0fbb31c811b8052daf5c43078a8 Mon Sep 17 00:00:00 2001 From: acamu Date: Sat, 4 Nov 2017 15:42:23 +0100 Subject: [PATCH 1/6] New versiob with empty folder --- group_vars/all | 9 +++++---- host-firsttime | 9 +++++++++ host_vars/pi1 | 3 +++ host_vars/pi2 | 3 +++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100755 host-firsttime create mode 100644 host_vars/pi1 create mode 100644 host_vars/pi2 diff --git a/group_vars/all b/group_vars/all index 69795ef..322bece 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,6 +1,7 @@ --- -<<<<<<< HEAD remote_directory: '/home/acam/Public/git/ansible-raspberry-sshupdate' -======= -remote_directory: '/home/acam/Public/git/ansible-raspberry-sshupdate/' ->>>>>>> 7a00d96e515279a7482a27f39a93c9b86f4fd0da + +foo: + pi1: one + pi2: two + diff --git a/host-firsttime b/host-firsttime new file mode 100755 index 0000000..63bcbd4 --- /dev/null +++ b/host-firsttime @@ -0,0 +1,9 @@ +[pi_master_host] +master ansible_host=127.0.0.1 ansible_connection=local ansible_user=acam + + +# first time with nothing about ssh +[pi_remote_hosts] +pi1 ansible_host=192.168.1.59 ansible_user=pi ansible_ssh_pass='raspberry' + + diff --git a/host_vars/pi1 b/host_vars/pi1 new file mode 100644 index 0000000..2238bc4 --- /dev/null +++ b/host_vars/pi1 @@ -0,0 +1,3 @@ +--- +ansible_user: "pi" +ansible_ssh_private_key_file: '/home/acam/Public/git/ansible-raspberry-sshupdate/keys-master/id_rsa' diff --git a/host_vars/pi2 b/host_vars/pi2 new file mode 100644 index 0000000..956708b --- /dev/null +++ b/host_vars/pi2 @@ -0,0 +1,3 @@ +--- +ansible_user: "pi" +ansible_ssh_private_key_file: '/home/acam/Public/git/ansible-raspberry-sshupdate/keys-master/id_rsa1' From e5718f36ab39845399975c77cd25d73aed3c0473 Mon Sep 17 00:00:00 2001 From: acamu Date: Sat, 4 Nov 2017 15:44:40 +0100 Subject: [PATCH 2/6] Update empty folder --- hosts | 12 +++--------- keys-remote/empty | 0 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 keys-remote/empty diff --git a/hosts b/hosts index f86dac4..63c9f0c 100755 --- a/hosts +++ b/hosts @@ -1,15 +1,9 @@ [pi_master_host] -master ansible_host=127.0.0.1 ansible_connection=local ansible_user=acam - - -# first time with nothing about ssh -#[pi_remote_hosts] -#pi1 ansible_host=192.168.1.59 ansible_user=pi ansible_ssh_pass='raspberry' - +master ansible_host=127.0.0.1 ansible_connection=local # second time and refresh ssh certificate [pi_remote_hosts] -pi1 ansible_host=192.168.1.59 ansible_user='pi' ansible_ssh_private_key_file='/home/acam/Public/git/ansible-raspberry-sshupdate/keys-master/id_rsa' -#not seem to be the true variable ansible_ssh_private_key_file_pass='/dev/null' +pi1 ansible_host=192.168.1.59 ansible_connection=ssh + diff --git a/keys-remote/empty b/keys-remote/empty deleted file mode 100644 index e69de29..0000000 From 82eb5c83040d71c53184604aa64f5f2f38bd039c Mon Sep 17 00:00:00 2001 From: acamu Date: Sat, 4 Nov 2017 15:47:19 +0100 Subject: [PATCH 3/6] Update : Add ignore and variable --- host_vars/master | 2 ++ keys-master/.gitignore | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 host_vars/master create mode 100644 keys-master/.gitignore diff --git a/host_vars/master b/host_vars/master new file mode 100644 index 0000000..890bb99 --- /dev/null +++ b/host_vars/master @@ -0,0 +1,2 @@ +--- +ansible_user: "acam" diff --git a/keys-master/.gitignore b/keys-master/.gitignore new file mode 100644 index 0000000..76bedae --- /dev/null +++ b/keys-master/.gitignore @@ -0,0 +1,5 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore + From 57b947bc8448233a1fac84a4edd6d42174fa24d5 Mon Sep 17 00:00:00 2001 From: acamu Date: Sat, 4 Nov 2017 15:52:18 +0100 Subject: [PATCH 4/6] Update --- detector-1.py | 38 -------------------------------------- keys-master/empty | 0 2 files changed, 38 deletions(-) delete mode 100644 detector-1.py delete mode 100644 keys-master/empty diff --git a/detector-1.py b/detector-1.py deleted file mode 100644 index f4bf79d..0000000 --- a/detector-1.py +++ /dev/null @@ -1,38 +0,0 @@ -import nmap -import json - - -rpi_ip_list = [] -rpi_name_list = [] - - -def pi_search(): - print ('Searching for RPi') - print ("---------------------------") - - nm = nmap.PortScanner() - nm.scan('192.168.1.0/24',arguments='-sP') #Note :I tested with -sP to save time - for host in nm.all_hosts(): - #print(host + " "+nm[host].hostname()) - item = nm[host]['addresses'] - if nm[host].hostname() == 'raspberrypi' : - print (nm[host].hostname(),item) - if 'mac' in nm[host]['addresses']: - print('mac address found: {}'.format(nm[host]['addresses'])) - print('vendor: {}'.format(nm[host]['vendor'])) - - print ("---------------------------") - -def main(): - - if rpi_ip_list == []: - print ('Running nmap') - pi_search() - - -if __name__ == "__main__": - main() - - -#arp -a | grep b8:27:eb | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' -#Nmap can only retrieve the MAC address if you are scanning hosts on the local subnet diff --git a/keys-master/empty b/keys-master/empty deleted file mode 100644 index e69de29..0000000 From 63d3f70bae5abf2e5e9fdcce1f3766fc0d81cb34 Mon Sep 17 00:00:00 2001 From: acamu Date: Sat, 4 Nov 2017 15:53:30 +0100 Subject: [PATCH 5/6] Update --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5c52af7..8fddf68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/keys-master/* -/keys-remote/* +#/keys-master/* +#/keys-remote/* From e4edf5c7ef79ae06d8a46f3a995fd0a609e93ed1 Mon Sep 17 00:00:00 2001 From: acamu Date: Sat, 4 Nov 2017 15:54:49 +0100 Subject: [PATCH 6/6] Update --- keys-remote/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 keys-remote/.gitignore diff --git a/keys-remote/.gitignore b/keys-remote/.gitignore new file mode 100644 index 0000000..76bedae --- /dev/null +++ b/keys-remote/.gitignore @@ -0,0 +1,5 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore +