Skip to content

Instantly share code, notes, and snippets.

@jlgaddis
Last active December 3, 2019 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlgaddis/5a00d6cf5ea5a460c59af743ca4cf23a to your computer and use it in GitHub Desktop.
Save jlgaddis/5a00d6cf5ea5a460c59af743ca4cf23a to your computer and use it in GitHub Desktop.
Minimal playbook to demonstrate bug in "ufw" module (see Ansible #65443)
# ufw.yml
---
- name: ufw.yml
hosts: debian-stable-amd64
become: true
tasks:
- name: Get "before" value of DEFAULT_INPUT_POLICY
command: "grep ^DEFAULT_INPUT_POLICY= /etc/default/ufw"
register: before
changed_when: false
args:
warn: false
- name: Display "before" value of DEFAULT_INPUT_POLICY
debug:
var: before.stdout
- name: Change default input policy from "drop" to "reject"
ufw:
direction: incoming
default: reject
- name: Get "after" value of DEFAULT_INPUT_POLICY
command: "grep ^DEFAULT_INPUT_POLICY= /etc/default/ufw"
register: after
changed_when: false
args:
warn: false
- name: Display "after" value of DEFAULT_INPUT_POLICY
debug:
var: after.stdout
@jlgaddis
Copy link
Author

jlgaddis commented Dec 3, 2019

Example playbook to demonstrate the issue experienced in Ansible #65443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment