isolated ramparts: replace systemd unit with a tower-expect binary

instead of launching isolated tasks via `systemctl`, treat
`awx.main.isolated.run` as an executable that knows how to daemonize

additionally, add `setup.py isolated_build` for isolated Tower source
distribution
This commit is contained in:
Ryan Petrello
2017-06-14 14:48:47 -04:00
parent 422950f45d
commit 44e0c8621a
13 changed files with 107 additions and 111 deletions

View File

@@ -17,7 +17,7 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR /
EXPOSE 22
ADD tools/docker-isolated/playbook@.service /lib/systemd/system/playbook@.service
ADD tools/docker-isolated/tower-expect /usr/local/bin/tower-expect
RUN rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_ecdsa_key

View File

@@ -66,6 +66,6 @@ This should give a shell to the `tools_isolated_1` container, as the
The following command would run the playbook for job 57.
```bash
systemctl start playbook@57.service
tower-expect start 57
```

View File

@@ -1,7 +0,0 @@
[Unit]
Description=Run of Ansible Tower job %I
[Service]
ExecStart=/venv/tower_isolated/bin/python /tower_isolated/run.py %I
Restart=no
Environment=TOWER_LIB_DIRECTORY=/tower_lib

View File

@@ -0,0 +1,3 @@
#!/bin/bash
. /venv/tower_isolated/bin/activate
exec env TOWER_LIB_DIRECTORY=/tower_lib /tower_isolated/run.py "$@"