Skip to content

Commit

Permalink
Move the important variables to init.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tleguern committed May 20, 2021
1 parent 344d54f commit 1e59902
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 9 additions & 5 deletions init.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
---
- name: Initialize important variables.
set_fact:
death: no
hit: no
testing: no
debug: no
commands: ['move', 'shoot']
failedhit: no

- name: Init | Generate the Cave's rooms.
include_tasks: "cave-{{ cave_type }}.yml"

Expand All @@ -13,11 +22,6 @@
loop_control:
loop_var: what

- name: Init | Set initial number of arrows.
set_fact:
arrows: 5
when: arrows is not defined

- name: Init | Define position loop variable.
set_fact:
_continue: yes
Expand Down
2 changes: 1 addition & 1 deletion shoot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
set_fact:
arrow: "{{ position }}"

- name: Shoot | Define necessary variables.
- name: Shoot | Reset necessary variables.
set_fact:
roomcnt: "0"
toofar: no
Expand Down
6 changes: 1 addition & 5 deletions wumpus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
- hosts: localhost
gather_facts: no
vars:
death: no
hit: no
testing: no
debug: no
commands: ['move', 'shoot']
cave_type: 'dodecahedron'
arrows: 5
tasks:
- name: Initialize the game.
include_tasks: init.yml
Expand Down

0 comments on commit 1e59902

Please sign in to comment.