mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-11-02 14:30:15 +00:00
fix runonce script for .Renviron
This commit is contained in:
1 parent
f4dfc67e55
commit
cb7abdfaf6
10 files changed
+40
-19
No files matched your search
@@ -3,3 +3,4 @@
|
||||
- import_tasks: chocolatey.yml
|
||||
- import_tasks: rdgw.yml
|
||||
- import_tasks: start_menu.yml
|
||||
- import_tasks: runonce.yml
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Copy logon script to VMs
|
||||
tags: runonce
|
||||
win_template:
|
||||
src: "logon.ps1.j2"
|
||||
dest: "C:\\eidf\\logon.ps1"
|
||||
force: true
|
||||
when: project_zone == 'protected'
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
$bashProfilePath = Join-Path $HOME ".bash_profile"
|
||||
|
||||
if ( -not ( Test-Path -Path $bashProfilePath ) ) {
|
||||
$requiredLine = 'eval "$(''/C/tools/miniforge3/Scripts/conda.exe'' ''shell.bash'' ''hook'')"'
|
||||
|
||||
Add-Content -Path $bashProfilePath -Value $requiredLine
|
||||
Set-ItemProperty -Path $bashProfilePath -Name Attributes -Value ([System.IO.FileAttributes]::Hidden)
|
||||
}
|
||||
|
||||
|
||||
$Renviron_path = Join-Path $HOME "Documents\.Renviron"
|
||||
|
||||
if ( -not ( Test-Path -Path $Renviron_path ) ) {
|
||||
$Renviron_contents = @"
|
||||
http_proxy=http://{{ proxy_address }}
|
||||
https_proxy=http://{{ proxy_address }}
|
||||
"@
|
||||
|
||||
Add-Content $Renviron_path $Renviron_contents
|
||||
}
|
||||
@@ -3,3 +3,5 @@ start_menu_xml: "C:\\eidf\\{{ win_project }}.xml"
|
||||
backup_xml: "C:\\eidf\\{{ win_project }}-old.xml"
|
||||
script_name: newXML.py
|
||||
script_path: "C:\\eidf\\{{ script_name }}"
|
||||
proxy_vm: "{{ os_project }}-{{ win_project }}-proxy"
|
||||
proxy_address: "{{ hostvars[proxy_vm].ansible_host }}:3128"
|
||||
Reference in new issue
Block a user