mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 04:24:00 -07:00
Add Fedora Python 3 Docker images and fix tests. (#27794)
* Add new Fedora docker images with Python 3. * Use consistent env var for lookup test. * Fix testing of virtualenv with Python 3. * Fix docker_secret tests on Fedora 26. * Add Python 3 support to Fedora postgresql test. * Add Python 3 support to Fedora mysql tests. * Fix uri test server for Python 3 on Fedora. * Fix iso_extract test for Python 3 on Fedora. * Add Python 3 support for Fedora to openssl tests. * Fix dnf group test for Python 3 on Fedora. * Use force with user deletion in become test.
This commit is contained in:
parent
c43a10bd69
commit
c59e32469f
12 changed files with 189 additions and 22 deletions
|
@ -80,3 +80,4 @@
|
|||
name: "{{ become_test_user }}"
|
||||
state: "absent"
|
||||
remove: "yes"
|
||||
force: "yes"
|
||||
|
|
|
@ -242,9 +242,11 @@
|
|||
register: dnf_result
|
||||
|
||||
# GROUP INSTALL
|
||||
- name: install RPM Development Tools group
|
||||
# Using 'Books and Guides' because it is only 5 packages and a 7.3 M download on Fedora 26.
|
||||
# It also doesn't install anything that will tamper with our Python environment.
|
||||
- name: install Books and Guides group
|
||||
dnf:
|
||||
name: "@RPM Development Tools"
|
||||
name: "@Books and Guides"
|
||||
state: present
|
||||
register: dnf_result
|
||||
|
||||
|
@ -263,14 +265,14 @@
|
|||
- "'results' in dnf_result"
|
||||
|
||||
# cleanup until https://github.com/ansible/ansible/issues/27377 is resolved
|
||||
- shell: dnf -y group install "RPM Development Tools" && dnf -y group remove "RPM Development Tools"
|
||||
- shell: dnf -y group install "Books and Guides" && dnf -y group remove "Books and Guides"
|
||||
|
||||
# GROUP UPGRADE - this will go to the same method as group install
|
||||
# but through group_update - it is its invocation we're testing here
|
||||
# see commit 119c9e5d6eb572c4a4800fbe8136095f9063c37b
|
||||
- name: install latest RPM Development Tools
|
||||
- name: install latest Books and Guides
|
||||
dnf:
|
||||
name: "@RPM Development Tools"
|
||||
name: "@Books and Guides"
|
||||
state: latest
|
||||
register: dnf_result
|
||||
|
||||
|
@ -289,4 +291,4 @@
|
|||
- "'results' in dnf_result"
|
||||
|
||||
# cleanup until https://github.com/ansible/ansible/issues/27377 is resolved
|
||||
- shell: dnf -y group install "RPM Development Tools" && dnf -y group remove "RPM Development Tools"
|
||||
- shell: dnf -y group install "Books and Guides" && dnf -y group remove "Books and Guides"
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
command: dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
|
||||
|
||||
- name: Update cache
|
||||
command: dnf makecache fast
|
||||
command: dnf makecache
|
||||
|
||||
- name: Install docker
|
||||
dnf:
|
||||
name: docker-ce
|
||||
state: present
|
||||
enablerepo: docker-ce-test
|
||||
|
|
|
@ -29,13 +29,20 @@
|
|||
state: present
|
||||
when: ansible_distribution in ['CentOS']
|
||||
|
||||
- name: Install 7zip package if we are on Fedora or CentOS
|
||||
- name: Install 7zip package if we are on Fedora
|
||||
dnf:
|
||||
name: p7zip-plugins
|
||||
state: installed
|
||||
become: yes
|
||||
when: ansible_distribution in ['Fedora']
|
||||
|
||||
- name: Install 7zip package if we are on CentOS
|
||||
yum:
|
||||
name: p7zip-plugins
|
||||
state: installed
|
||||
update_cache: yes
|
||||
become: yes
|
||||
when: ansible_distribution in ['Fedora', 'CentOS']
|
||||
when: ansible_distribution in ['CentOS']
|
||||
|
||||
- name: Install 7zip package if we are on OpenSUSE
|
||||
zypper:
|
||||
|
|
|
@ -149,26 +149,21 @@
|
|||
|
||||
# ENV LOOKUP
|
||||
|
||||
- name: get first environment var name
|
||||
shell: env | fgrep -v '.' | head -n1 | cut -d\= -f1
|
||||
register: known_var_name
|
||||
- name: get HOME environment var value
|
||||
shell: "echo $HOME"
|
||||
register: home_var_value
|
||||
|
||||
- name: get first environment var value
|
||||
shell: echo {{ '$' + known_var_name.stdout }}
|
||||
register: known_var_value
|
||||
|
||||
- name: use env lookup to get known var
|
||||
- name: use env lookup to get HOME var
|
||||
set_fact:
|
||||
test_val: "{{ lookup('env', known_var_name.stdout) }}"
|
||||
test_val: "{{ lookup('env', 'HOME') }}"
|
||||
|
||||
- debug: var=known_var_name.stdout
|
||||
- debug: var=known_var_value.stdout
|
||||
- debug: var=home_var_value.stdout
|
||||
- debug: var=test_val
|
||||
|
||||
- name: compare values
|
||||
assert:
|
||||
that:
|
||||
- "test_val == known_var_value.stdout"
|
||||
- "test_val == home_var_value.stdout"
|
||||
|
||||
|
||||
# PIPE LOOKUP
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
mysql_service: 'mariadb'
|
||||
|
||||
mysql_packages:
|
||||
- mariadb-server
|
||||
- python3-mysql
|
||||
- bzip2
|
|
@ -1 +1,2 @@
|
|||
pyopenssl_package_name: pyOpenSSL
|
||||
pyopenssl_package_name_python3: python3-pyOpenSSL
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
postgresql_packages:
|
||||
- "postgresql-server"
|
||||
- "python3-psycopg2"
|
||||
- "bzip2"
|
||||
- "xz"
|
||||
|
||||
pg_hba_location: "/var/lib/pgsql/data/pg_hba.conf"
|
||||
pg_dir: "/var/lib/pgsql/data"
|
|
@ -5,7 +5,11 @@ if __name__ == '__main__':
|
|||
import http.server
|
||||
import socketserver
|
||||
PORT = int(sys.argv[1])
|
||||
Handler = http.server.SimpleHTTPRequestHandler
|
||||
|
||||
class Handler(http.server.SimpleHTTPRequestHandler):
|
||||
pass
|
||||
|
||||
Handler.extensions_map['.json'] = 'application/json'
|
||||
httpd = socketserver.TCPServer(("", PORT), Handler)
|
||||
httpd.serve_forever()
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue