-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b6f4a7
commit ff952b5
Showing
13 changed files
with
91 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# defaults file | ||
--- | ||
virtualenv_python_version_major: 2 | ||
virtualenv_install_method: native | ||
# Only available for < 24.04 | ||
# virtualenv_install_method: pip | ||
|
||
virtualenv_python_version_major: 3 | ||
virtualenv_python_version: "{{ virtualenv_python_version_major }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# tasks file | ||
--- | ||
- name: install | native | install dependencies | ||
ansible.builtin.apt: | ||
name: "{{ virtualenv_install_native_apt_dependencies }}" | ||
state: "{{ apt_install_state | default('latest') }}" | ||
update_cache: true | ||
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" | ||
tags: | ||
- virtualenv-install-native-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# tasks file | ||
--- | ||
- name: install | pip | install dependencies | ||
ansible.builtin.apt: | ||
name: "{{ virtualenv_install_get_pip_apt_dependencies }}" | ||
state: "{{ apt_install_state | default('latest') }}" | ||
update_cache: true | ||
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" | ||
tags: | ||
- virtualenv-install-pip-dependencies | ||
|
||
- name: install | pip | install (latest) # noqa package-latest | ||
ansible.builtin.pip: | ||
name: "{{ virtualenv_install_get_pip_pip_dependencies }}" | ||
state: latest | ||
executable: "pip{{ virtualenv_python_version_major | string }}" | ||
tags: | ||
- virtualenv-install-pip-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
# tasks file | ||
--- | ||
- name: install dependencies | ||
ansible.builtin.apt: | ||
name: "{{ virtualenv_dependencies }}" | ||
state: "{{ apt_install_state | default('latest') }}" | ||
update_cache: true | ||
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" | ||
- name: install | native | ||
ansible.builtin.import_tasks: install-native.yml | ||
when: virtualenv_install_method == 'native' | ||
tags: | ||
- configuration | ||
- virtualenv | ||
- virtualenv-install | ||
- virtualenv-install-dependencies | ||
- virtualenv-install-native | ||
|
||
- name: install | pip | ||
ansible.builtin.import_tasks: install-pip.yml | ||
when: virtualenv_install_method == 'pip' | ||
tags: | ||
- configuration | ||
- virtualenv | ||
- virtualenv-install-pip | ||
|
||
- name: install # noqa package-latest | ||
ansible.builtin.pip: | ||
name: "{{ virtualenv_pip_dependencies }}" | ||
state: latest | ||
executable: "pip{{ virtualenv_python_version_major | string }}" | ||
- name: verify | ||
ansible.builtin.command: > | ||
virtualenv --version | ||
changed_when: false | ||
tags: | ||
- configuration | ||
- virtualenv | ||
- virtualenv-install | ||
- virtualenv-install-verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
# pre test file | ||
--- | ||
- name: pip | check | ||
ansible.builtin.shell: > | ||
which pip | ||
register: _pip_installed | ||
changed_when: false | ||
check_mode: false | ||
failed_when: false | ||
|
||
- name: pip | install | ||
when: _pip_installed.rc != 0 | ||
- name: pip | ||
when: virtualenv_install_method == 'pip' | ||
block: | ||
- name: dependencies | install | ||
ansible.builtin.apt: | ||
name: | ||
- "python{{ virtualenv_python_version_major is version('3', '>=') | ternary('3', '') }}" | ||
- curl | ||
state: "{{ apt_install_state | default('latest') }}" | ||
update_cache: true | ||
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" | ||
|
||
- name: pip | install # noqa command-instead-of-module | ||
- name: pip | check | ||
ansible.builtin.shell: > | ||
curl -sL {{ virtualenv_get_pip_url }} | python{{ virtualenv_python_version_major | string }} - | ||
which pip | ||
register: _pip_installed | ||
changed_when: false | ||
tags: | ||
- skip_ansible_lint | ||
check_mode: false | ||
failed_when: false | ||
|
||
- name: pip | install | ||
when: _pip_installed.rc != 0 | ||
block: | ||
- name: dependencies | install | ||
ansible.builtin.apt: | ||
name: | ||
- "python{{ virtualenv_python_version_major is version('3', '>=') | ternary('3', '') }}" | ||
- curl | ||
state: "{{ apt_install_state | default('latest') }}" | ||
update_cache: true | ||
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" | ||
|
||
- name: pip | install # noqa command-instead-of-module | ||
ansible.builtin.shell: > | ||
curl -sL {{ virtualenv_get_pip_url }} | python{{ virtualenv_python_version_major | string }} - | ||
changed_when: false | ||
tags: | ||
- skip_ansible_lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# test file | ||
--- | ||
- hosts: localhost | ||
- name: converge | ||
hosts: localhost | ||
connection: local | ||
become: true | ||
pre_tasks: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# test file | ||
--- | ||
- hosts: all | ||
- name: converge | ||
hosts: all | ||
remote_user: vagrant | ||
become: true | ||
pre_tasks: | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# vars file | ||
--- | ||
virtualenv_python_version_major: 3 | ||
virtualenv_get_pip_url: 'https://bootstrap.pypa.io/pip/get-pip.py' | ||
virtualenv_install_method: pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# vars file | ||
--- | ||
virtualenv_install_method: native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
# vars file | ||
--- | ||
virtualenv_dependencies: | ||
virtualenv_install_native_apt_dependencies: | ||
- "python{{ virtualenv_python_version_major is version('3', '>=') | ternary('3', '') }}-virtualenv" | ||
- "python{{ virtualenv_python_version_major is version('3', '>=') | ternary('3', '') }}-virtualenvwrapper" | ||
|
||
virtualenv_install_get_pip_apt_dependencies: | ||
- "python{{ virtualenv_python_version_major is version('3', '>=') | ternary('3', '') }}" | ||
|
||
virtualenv_pip_dependencies: | ||
virtualenv_install_get_pip_pip_dependencies: | ||
- virtualenv | ||
- virtualenvwrapper |