-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe52375
commit 653458f
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[defaults] | ||
inventory = hosts | ||
remote_user = ssoroosh | ||
port = 22 | ||
host_key_checking = False | ||
|
||
[privilege_escalation] | ||
become = True | ||
become_method = sudo | ||
become_user = root | ||
become_pass = a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ITNOA | ||
|
||
- name: Install vim | ||
hosts: workers | ||
become: True | ||
tasks: | ||
- name: Ansible Upgrade all Packages | ||
register: updatesys | ||
apt: | ||
upgrade: full | ||
state: latest | ||
update_cache: yes | ||
cache_valid_time: 3600 | ||
- name: Display the last line of the previous task to show that the cache was updated | ||
debug: | ||
msg: "{{updatesys.stdout}}" | ||
- name: install vim | ||
apt: name=vim state=latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# ITNOA | ||
|
||
[workers] | ||
host1 ansible_host=172.22.64.3 | ||
host2 ansible_host=172.22.64.4 | ||
host3 ansible_host=172.22.64.5 | ||
host4 ansible_host=172.22.64.6 | ||
|
||
[all:vars] | ||
ansible_connection=ssh | ||
ansible_user=ssoroosh | ||
ansible_ssh_pass=a | ||
ansible_become_pass=a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ITNOA | ||
|
||
Install-Module 7Zip4PowerShell -Scope CurrentUser -Force -Verbose | ||
|
||
# Install choco | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
|
||
# Install Ubuntu On Windows | ||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux | ||
|
||
Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile ~/Ubuntu.zip -UseBasicParsing | ||
|
||
# OpenSSH | ||
# Install the OpenSSH Client | ||
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 | ||
|
||
# Install the OpenSSH Server | ||
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | ||
|
||
# Start the sshd service | ||
Start-Service sshd | ||
|
||
# OPTIONAL but recommended: | ||
Set-Service -Name sshd -StartupType 'Automatic' | ||
|
||
# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify | ||
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) { | ||
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..." | ||
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | ||
} else { | ||
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists." | ||
} |