Last active
May 4, 2022 10:43
-
-
Save jficz/522f55b78a49a4113d524e9a63dc52b8 to your computer and use it in GitHub Desktop.
Ansible ignores tag
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
`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