Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Update usage example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
p-j-smith committed Feb 9, 2023
1 parent 9907485 commit 3eb498e
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you would like to run Ansible Molecule to test this role, the requirements ar

## Role Variables

`install_python` is a dictionary contains the following varialbes:
`install_python` is a dictionary that contains the following varialbes:

`version`: the version of Python to install. This defaults to `"3"`.

Expand All @@ -35,30 +35,11 @@ There are no Ansible-Galaxy dependencies for this role.

## Example Playbook

### Basic usage

This role uses the Ansible facts `ansible_os_family` and `ansible_distribution_major_version` to determine whether Python 2 or Python 3
should be installed on your managed host. As such, you will need to gather these facts when using this role:

```yaml
- name: Install Python 3
hosts: all
gather_facts: true
roles:
- mirsg.install_python
```

This will gather all facts before installing Python. If you would like to install only the necessary facts (`ansible_os_family` and `ansible_distribution_major_version`) to run the role and install Python, you can use `gather_subset`:
This role will install Python on a managed host. To used this role, add it to the list of roles in a play:

```yaml
- name: Install Python 3
- name: Install Python
hosts: all
gather_facts: true
gather_subset:
- "os_family"
- "distribution_major_version"
- "!min"
- "!all"
roles:
- mirsg.install_python
```
Expand Down

0 comments on commit 3eb498e

Please sign in to comment.