more isolated task execution tweaking

* set a more reasonable default `AWX_ISOLATED_CHECK_INTERVAL`
* make manual cancellation work for high values of
  `AWX_ISOLATED_CHECK_INTERVAL`
* remove the `/tmp/ansible_tower/jobs/` symlink directory

see: #6616
This commit is contained in:
Ryan Petrello
2017-06-16 11:18:01 -04:00
parent 44e0c8621a
commit 1ea03aa4c9
9 changed files with 36 additions and 37 deletions

View File

@@ -2,7 +2,6 @@
# The following variables will be set by the runner of this playbook:
# src: /tmp/some/path/private_data_dir/
# job_id: <pk>
- hosts: all
gather_facts: false
@@ -16,6 +15,6 @@
mode: pull
recursive: yes
- shell: "tower-expect is-alive {{job_id}}"
- shell: "tower-expect is-alive {{src}}"
register: is_alive
failed_when: "is_alive.rc == 0"

View File

@@ -1,8 +1,8 @@
---
# The following variables will be set by the runner of this playbook:
# private_dirs: ['/tmp/path/private_data_dir/', '/tmp//path/proot_temp_dir/']
# job_id: <pk>
# cleanup_dirs: ['/tmp/path/private_data_dir/', '/tmp//path/proot_temp_dir/']
# private_data_dir: '/tmp/path/private_data_dir/'
- hosts: all
gather_facts: false
@@ -10,9 +10,9 @@
tasks:
- name: cancel the job
command: "tower-expect stop {{job_id}}"
command: "tower-expect stop {{private_data_dir}}"
ignore_errors: yes
- name: remove build artifacts
file: path="{{item}}" state=absent
with_items: "{{private_dirs}}"
with_items: "{{cleanup_dirs}}"

View File

@@ -4,7 +4,6 @@
# src: /tmp/some/path/private_data_dir
# dest: /tmp/some/path/
# proot_temp_dir: /tmp/some/path
# job_id: <pk>
- hosts: all
gather_facts: false
@@ -26,20 +25,14 @@
src: "{{src}}"
dest: "{{dest}}"
- name: create a directory for running jobs
file: path=/tmp/ansible_tower/jobs state=directory mode=0700
- name: create symlink keyed by job ID
file: src="{{src}}" dest="/tmp/ansible_tower/jobs/{{job_id}}" state=link
- name: create a named pipe for secret environment data
command: "mkfifo /tmp/ansible_tower/jobs/{{job_id}}/env"
command: "mkfifo {{src}}/env"
- name: spawn the playbook
command: "tower-expect start {{job_id}}"
command: "tower-expect start {{src}}"
- name: write the secret environment data
mkfifo:
content: "{{secret}}"
path: "/tmp/ansible_tower/jobs/{{job_id}}/env"
path: "{{src}}/env"
no_log: True