Skip to content

Commit

Permalink
✨ prompt_password: support Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
huyz committed Aug 4, 2024
1 parent d6fdccd commit ddfbbc9
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 6 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ huyz.general Release Notes
.. contents:: Topics


v1.1.0
======

Release Summary
---------------

| Release Date: 2024-08-04
| prompt_password - support Windows

Major Changes
-------------

- prompt_password - support Windows

v1.0.4
======

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Update the `title` and set `keep_fragments: true`.

#### After each change

Create a manual fragments in `changeslogs/fragments`.
First, create a manual fragments in `changeslogs/fragments`.

To lint the fragments:
Then, to lint the fragments:

```shell
antsibull-changelog lint
Expand All @@ -70,14 +70,16 @@ collections:
```

```shell
# Add -f to force the update
install.sh
```


#### For a new release

Create a manual fragment in `changeslogs/fragments` named `DATE_vVERSION_summary.yml` with `release_summary` property.
First, create a manual fragment in `changeslogs/fragments` named `DATE_vVERSION_summary.yml` with `release_summary` property.

Generate the changelog for the release:
Then, generate the changelog for the release:

```shell
antsibull-changelog release --refresh-fragments --update-existing
Expand Down
13 changes: 13 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ releases:
- 2023-05-12_fix_posix_dependency.yml
- 2023-05-12_v1.0.4_summary.yml
release_date: '2023-05-12'
1.1.0:
changes:
major_changes:
- prompt_password - support Windows
release_summary: '| Release Date: 2024-08-04
| prompt_password - support Windows
'
fragments:
- 2024-08-04_prompt_password_support_windows.yml
- 2024-08-04_v1.1.0_summary.yml
release_date: '2024-08-04'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
major_changes:
- prompt_password - support Windows
3 changes: 3 additions & 0 deletions changelogs/fragments/2024-08-04_v1.1.0_summary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2024-08-04
| prompt_password - support Windows
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: huyz
name: general

# The version of the collection. Must be compatible with semantic versioning
version: 1.0.4
version: 1.1.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
2 changes: 2 additions & 0 deletions roles/prompt_password/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Prompts for the `ansible_password` if not defined, with the option to also set t

This avoids the need to call `ansible-playbook` with `--ask-pass` and `--ask-become-pass`.

This works when `ansible_become_method` is set to `sudo` or, for Windows, `ansible.builtin.runas`.

## Installation

This repo uses the FQCN convention.
Expand Down
8 changes: 7 additions & 1 deletion roles/prompt_password/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@
ansible.builtin.command: '/usr/bin/true'
changed_when: false
become: true
when: password_prompt.user_input is defined
when: password_prompt.user_input is defined and ansible_become_method == 'sudo'

- name: WIN_SHELL | Test the password for fail-fast
ansible.windows.win_command: "cmd.exe /c rem"
changed_when: false
become: true
when: password_prompt.user_input is defined and ansible_become_method == 'ansible.builtin.runas'

0 comments on commit ddfbbc9

Please sign in to comment.