mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Support for executing job and adhoc commands on isolated Tower nodes (#6524)
This commit is contained in:
24
awx/playbooks/library/mkfifo.py
Executable file
24
awx/playbooks/library/mkfifo.py
Executable file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
import stat
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec={
|
||||
'path': {'required': True, 'type': 'str'},
|
||||
'content': {'required': True, 'type': 'str'}
|
||||
},
|
||||
supports_check_mode=False
|
||||
)
|
||||
|
||||
path = module.params['path']
|
||||
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
|
||||
with open(path, 'w') as fifo:
|
||||
fifo.write(module.params['content'])
|
||||
module.exit_json(dest=path, changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user