Browse code

[stable-2.10] Support macOS 10.15 for ansible-test --remote.

Use of this new version is experimental, so it is not enabled in CI yet.
(cherry picked from commit 2bbcbe99fdc61a0885eae9d14b4c74883c12601b)

Co-authored-by: Matt Clay <matt@mystile.com>

Matt Clay authored on 2020/08/28 04:08:38
Showing 5 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+minor_changes:
1
+  - ansible-test - Add ``macos/10.15`` as a supported value for the ``--remote`` option.
... ...
@@ -1,6 +1,7 @@
1 1
 freebsd/11.1 python=2.7,3.6 python_dir=/usr/local/bin
2 2
 freebsd/12.1 python=3.6,2.7 python_dir=/usr/local/bin
3 3
 osx/10.11 python=2.7 python_dir=/usr/local/bin
4
+macos/10.15 python=3.8 python_dir=/usr/local/bin
4 5
 rhel/7.6 python=2.7
5 6
 rhel/7.8 python=2.7
6 7
 rhel/8.1 python=3.6
... ...
@@ -88,6 +88,14 @@ elif [ "${platform}" = "centos" ]; then
88 88
     done
89 89
 
90 90
     install_pip
91
+elif [ "${platform}" = "macos" ]; then
92
+    while true; do
93
+        pip3 install --disable-pip-version-check --quiet \
94
+            'virtualenv<20' \
95
+        && break
96
+        echo "Failed to install packages. Sleeping before trying again..."
97
+        sleep 10
98
+    done
91 99
 elif [ "${platform}" = "osx" ]; then
92 100
     while true; do
93 101
         pip install --disable-pip-version-check --quiet \
... ...
@@ -148,4 +156,7 @@ EOF
148 148
 # Make sure ~/ansible/ is the starting directory for interactive shells.
149 149
 if [ "${platform}" = "osx" ]; then
150 150
     echo "cd ~/ansible/" >> ~/.bashrc
151
+elif [ "${platform}" = "macos" ] ; then
152
+    echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bashrc
153
+    echo "cd ~/ansible/" >> ~/.bashrc
151 154
 fi
... ...
@@ -111,6 +111,7 @@ class AnsibleCoreCI:
111 111
                 'centos arch=power',  # avoid ibmvpc as default for no-arch centos to avoid making centos default to power
112 112
             ),
113 113
             parallels=(
114
+                'macos',
114 115
                 'osx',
115 116
             ),
116 117
         )
... ...
@@ -211,6 +211,8 @@ class ManagePosixCI:
211 211
                 self.become = ['sudo', '-in', 'sh', '-c']
212 212
             else:
213 213
                 raise NotImplementedError('provider %s has not been implemented' % self.core_ci.provider)
214
+        elif self.core_ci.platform == 'macos':
215
+            self.become = ['sudo', '-in', 'PATH=/usr/local/bin:$PATH', 'sh', '-c']
214 216
         elif self.core_ci.platform == 'osx':
215 217
             self.become = ['sudo', '-in', 'PATH=/usr/local/bin:$PATH']
216 218
         elif self.core_ci.platform == 'rhel' or self.core_ci.platform == 'centos':