diff --git a/images/linux/scripts/installers/ansible.sh b/images/linux/scripts/installers/ansible.sh index d566e5b77..cf63f5073 100644 --- a/images/linux/scripts/installers/ansible.sh +++ b/images/linux/scripts/installers/ansible.sh @@ -4,16 +4,11 @@ ## Desc: Installs Ansible ################################################################################ -# Source the helpers for use with the script -source $HELPER_SCRIPTS/os.sh - -# ppa:ansible/ansible doesn't contain packages for Ubuntu20.04 -if isUbuntu16 || isUbuntu18 ; then - add-apt-repository ppa:ansible/ansible - apt-get update -fi - +# this script is used only on Ubuntu 16.04 +# for Ubuntu 18.04 and 20.04 we use pipx ansible-base package # Install latest Ansible +add-apt-repository ppa:ansible/ansible +apt-get update apt-get install -y --no-install-recommends ansible invoke_tests "Tools" "Ansible" diff --git a/images/linux/scripts/tests/Common.Tests.ps1 b/images/linux/scripts/tests/Common.Tests.ps1 index b65a18c38..4a0c16f8c 100644 --- a/images/linux/scripts/tests/Common.Tests.ps1 +++ b/images/linux/scripts/tests/Common.Tests.ps1 @@ -43,6 +43,6 @@ Describe "PipxPackages" -Skip:(Test-IsUbuntu16) { [array]$testCases = (Get-ToolsetContent).pipx | ForEach-Object { @{cmd = $_.cmd} } It "" -TestCases $testCases { - "$cmd --version" | Should -ReturnZeroExitCode + "$cmd --version" | Should -ReturnZeroExitCode } } diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index 0e82254c7..cc65f1cf5 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -218,6 +218,10 @@ { "package": "aws-sam-cli", "cmd": "sam" + }, + { + "package": "ansible-base", + "cmd": "ansible" } ], "dotnet": { diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index 2e644c1fb..125c00f17 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -219,6 +219,10 @@ { "package": "aws-sam-cli", "cmd": "sam" + }, + { + "package": "ansible-base", + "cmd": "ansible" } ], "dotnet": { diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index faa2fe3bf..b4a54f47a 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -188,7 +188,6 @@ { "type": "shell", "scripts": [ - "{{template_dir}}/scripts/installers/ansible.sh", "{{template_dir}}/scripts/installers/azcopy.sh", "{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-devops-cli.sh", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 2b52f1c18..7c0ca2b57 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -188,7 +188,6 @@ { "type": "shell", "scripts": [ - "{{template_dir}}/scripts/installers/ansible.sh", "{{template_dir}}/scripts/installers/azcopy.sh", "{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-devops-cli.sh",