Skip to content

Commit

Permalink
Add ubuntu wsl in windows preparing. (see #19)
Browse files Browse the repository at this point in the history
  • Loading branch information
soroshsabz committed Mar 28, 2022
1 parent 653458f commit 11cb793
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
17 changes: 17 additions & 0 deletions Deployment/Ansible/playbooks/host-dependent-write.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ITNOA

- name: show write custom value based on host in each host
hosts: all
tasks:
- name: show write custom value based on host in each host
# command: echo "{{hostvars['{{inventory_hostname}}']['custom_var']}}"
shell: >
echo "{{ hostvars[inventory_hostname]['ss'] }}aa" | tee /tmp/host_var.txt
# echo "{{ hostvars[item]['ss'] }}" | tee /tmp/host_var.txt
# when: ansible_hostname == "item"
# with_items:
# - "{{ groups['workers'] }}"
- debug:
# msg: "{{hostvars['{{inventory_hostname}}']}}"
msg: "{{inventory_hostname}}"

8 changes: 4 additions & 4 deletions Deployment/Ansible/playbooks/hosts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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
host1 ansible_host=172.22.64.3 ss=3
host2 ansible_host=172.22.64.4 ss=4
host3 ansible_host=172.22.64.5 ss=5
host4 ansible_host=172.22.64.6 ss=6

[all:vars]
ansible_connection=ssh
Expand Down
7 changes: 7 additions & 0 deletions Deployment/Powershell/prepare-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-L

Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile ~/Ubuntu.zip -UseBasicParsing

Expand-Archive ~/Ubuntu.zip C:\Distros\Ubuntu

Set-Location C:\Distros\Ubuntu

# TODO: Correct name based on version
Add-AppxPackage .\Ubuntu_2004.2021.825.0_x64.appx

# OpenSSH
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Expand Down

0 comments on commit 11cb793

Please sign in to comment.