Install ansible by pip if needed 83/74783/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Mon, 3 Mar 2025 20:22:40 +0000 (21:22 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 3 Mar 2025 20:22:40 +0000 (21:22 +0100)
Change-Id: I3d48e2d796b5ecbdc01fb41a3c5bf648f68fc376
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
jjb/functest/xtesting-ci.yaml

index 5e1ca47..213cb3c 100644 (file)
             sudo podman ps -aq |xargs sudo podman rm || true
           fi
           sudo rm -rfv /data /tmp/xtesting*
-          sudo apt-get install ansible patch -y
+          if [ $(lsb_release -r -s |cut -d\. -f1) -ge "22" ]; then
+            sudo apt-get install ansible patch -y
+          else
+            sudo apt-get install patch -y
+            sudo pip3 install ansible
+          fi
           rm -rf ~/.ansible/roles/collivier.xtesting
           case {release} in
           stable)
             fi
             sudo rm -rfv /data /tmp/xtesting*
           EOF
-          sudo apt-get install ansible patch -y
+          if [ $(lsb_release -r -s |cut -d\. -f1) -ge "22" ]; then
+            sudo apt-get install ansible patch -y
+          else
+            sudo apt-get install patch -y
+            sudo pip3 install ansible
+          fi
           rm -rf ~/.ansible/roles/collivier.xtesting
           case {release} in
           stable)