From 6ffc3201f59db8b81894ef31bc378781319ef7e6 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Thu, 18 Apr 2019 11:19:08 -0700 Subject: [PATCH] Changes! Updated Docs Updated InstallDocker to support Ubuntu dist release Added some Vagrant support Adjusting Nagios still --- README.md | 15 ++++---- playbook/linux/docker/InstallDocker.yml | 2 +- playbook/linux/nagios/deployNagios.yml | 28 --------------- ...install-NagiosCore-ubuntu-dependancies.yml | 11 ++++++ playbook/linux/nagios/installNagiosCore.yml | 12 +++++++ scripts/installAnsible.sh | 5 +++ scripts/installVagrant.sh | 35 +++++++++++++++++++ 7 files changed, 70 insertions(+), 38 deletions(-) delete mode 100644 playbook/linux/nagios/deployNagios.yml create mode 100644 playbook/linux/nagios/install-NagiosCore-ubuntu-dependancies.yml create mode 100644 playbook/linux/nagios/installNagiosCore.yml create mode 100755 scripts/installVagrant.sh diff --git a/README.md b/README.md index 97dc597..0b5b9ca 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,12 @@ chmod 777 installAnsible.sh #### Windows ```powershell - +$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1" +$file = "$env:temp\ConfigureRemotingForAnsible.ps1" +(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file) +powershell.exe -ExecutionPolicy ByPass -File $file ``` -Review the installAnsible.sh for quick setup. - -Make sure you run the commands out of this folder so things work as desired. - ## Configuration I have a basic configuration file in place at the root of this folder for anisble to find. @@ -32,10 +31,6 @@ I have a basic configuration file in place at the root of this folder for anisbl I have a template file in place that should only be used as a refrence. Make a copy of that file and name it hosts then update that file. -## Testing Inventory - - - ### Testing Linux devices ```bash @@ -48,5 +43,7 @@ ansible linux -i hosts -m ping ansible windows -i hosts -m win_ping ``` +## Unit Testing +Still in the works diff --git a/playbook/linux/docker/InstallDocker.yml b/playbook/linux/docker/InstallDocker.yml index 3ac542e..1264536 100644 --- a/playbook/linux/docker/InstallDocker.yml +++ b/playbook/linux/docker/InstallDocker.yml @@ -35,7 +35,7 @@ become: true become_method: sudo apt_repository: - repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ bionic stable" + repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ {{ ansible_distribution_release }} stable" state: present - name: Update Repos diff --git a/playbook/linux/nagios/deployNagios.yml b/playbook/linux/nagios/deployNagios.yml deleted file mode 100644 index 99bfb7b..0000000 --- a/playbook/linux/nagios/deployNagios.yml +++ /dev/null @@ -1,28 +0,0 @@ -- name: Install Nagios Core - hosts: nagios - - tasks: - - name: Install requrements - apt: - name: {{ packages }} - vars: - packages: - - install - - build-essential - - libgd-dev - - openssl - - libssl-dev - - unzip - - apache2 - - - name: Make Group: Nagios - group: - name: nagios - - - - - - - name: Make User: Nagios - - diff --git a/playbook/linux/nagios/install-NagiosCore-ubuntu-dependancies.yml b/playbook/linux/nagios/install-NagiosCore-ubuntu-dependancies.yml new file mode 100644 index 0000000..8ee3767 --- /dev/null +++ b/playbook/linux/nagios/install-NagiosCore-ubuntu-dependancies.yml @@ -0,0 +1,11 @@ + + +- name: Install Nagios Core Dependancies + hosts: nagios + + tasks: + - name: Update apt + apt: + update_cache: yes + + diff --git a/playbook/linux/nagios/installNagiosCore.yml b/playbook/linux/nagios/installNagiosCore.yml new file mode 100644 index 0000000..29cd7ca --- /dev/null +++ b/playbook/linux/nagios/installNagiosCore.yml @@ -0,0 +1,12 @@ +- name: Install Nagios Core + hosts: nagios + + tasks: + - include_role: + name: oefenweb.nagios-server + # vars: + # nagios_version: 4.4.3 + # nagios_users: + #- user: nagiosadmin + #- pass: password + diff --git a/scripts/installAnsible.sh b/scripts/installAnsible.sh index 3111787..a4696fd 100644 --- a/scripts/installAnsible.sh +++ b/scripts/installAnsible.sh @@ -32,3 +32,8 @@ sudo pip install 'ansible[azure]' echo "[pip] Installing Docker module" sudo pip install docker + + +echo "Installing roles from galaxy.ansible.com" +echo "[galaxy] Nagios Core - Server Side " +ansible-galaxy install networklore.nagios diff --git a/scripts/installVagrant.sh b/scripts/installVagrant.sh new file mode 100755 index 0000000..9d7c550 --- /dev/null +++ b/scripts/installVagrant.sh @@ -0,0 +1,35 @@ + +# This will install Vagrant on the device + +#1.0 Started to add Vagrant to the project + +echo "OS: $OSTYPE" +if [[ "$OSTYPE" == "darin"* ]]; then + +# I use debian so sudo +elif [[ "$OSTYPE" == "linux-gnu" ]]; then + + # Download current release + wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_linux_amd64.zip + + unzip vagrant_2.2.4_linux_amd64.zip + + # Remove the zip + rm vagrant_2.2.4_linux_amd64.zip + + # copy over to bin + sudo cp vagrant /usr/bin/vagrant + + rm vagrant + + echo "Installing VirtualBox 6" + wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - + wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - + sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian cosmic contrib" + sudo apt update + sudo apt install virtualbox-6.0 +else + echo "You are running on a OS that is not supported by this script at this time." + echo "No changes have been made." + exit +fi