Skip to content

Instantly share code, notes, and snippets.

@jficz
Last active May 4, 2022 10:43
Show Gist options
  • Save jficz/522f55b78a49a4113d524e9a63dc52b8 to your computer and use it in GitHub Desktop.
Save jficz/522f55b78a49a4113d524e9a63dc52b8 to your computer and use it in GitHub Desktop.
Ansible ignores tag
`ansible-playbook -i <inv> playbook.yaml -t bootstrap`
--- # `playbook.yaml`
- name: Bootstrap
hosts: all
tasks:
- import_role:
name: "bootstrap"
tags:
- bootstrap
--- # `roles/bootstrap/tasks/main.yaml`
- name: Create config directory
file:
path: "{{ conf_dir }}"
state: directory
- include_role:
name: 'app_deploy'
vars:
app_state: 'present'
--- # `roles/app_deploy/tasks/main.yaml`
- block:
- name: Create a local temporary directory # this task doesn't happen
tempfile:
path: '/tmp/'
state: directory
register: tmp_dir
- name: Pull app deploy config config # "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'path'"
fetch:
dest: '{{ tmp_dir.path }}/'
flat: true
src: '/etc/app/deploy.conf'
run_once: true #block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment