Last active
March 27, 2023 15:36
-
-
Save maxamillion/1550033d9b3a4ec7f0a6023e6b688d0c to your computer and use it in GitHub Desktop.
Running rulebook directly with receptor
This file contains hidden or 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
printf "/home/admiller/src/dev/receptor/test_rulebook.yml:/home/admiller/src/maxible/inventory.ini" | receptorctl --socket /tmp/foo.sock work submit ansible-rulebook --payload - |
This file contains hidden or 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
--- | |
- node: | |
id: bar | |
- log-level: | |
level: Debug | |
- tcp-peer: | |
address: localhost:2222 | |
- control-service: | |
service: control | |
- work-command: | |
worktype: ansible-rulebook | |
command: bash | |
params: "-c \"source /home/admiller/.virtualenvs/receptor/bin/activate; read -r paths; JAVA_HOME=/usr/lib/jvm/java-17-openjdk-17.0.6.0.10-1.fc37.x86_64/ ansible-rulebook -r ${paths%:*} -i ${paths#*:} --print-events\"" | |
- work-command: | |
workType: echopayload | |
command: bash | |
params: "-c \"while read -r line; do echo ${line^^}; sleep 5; done\"" |
This file contains hidden or 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
--- | |
- node: | |
id: foo | |
- log-level: | |
level: Debug | |
- tcp-listener: | |
port: 2222 | |
- control-service: | |
service: control | |
filename: /tmp/foo.sock | |
- work-command: | |
worktype: ansible-rulebook | |
command: bash | |
params: "-c \"source /home/admiller/.virtualenvs/receptor/bin/activate; read -r paths; JAVA_HOME=/usr/lib/jvm/java-17-openjdk-17.0.6.0.10-1.fc37.x86_64/ ansible-rulebook -r ${paths%:*} -i ${paths#*:} --print-events\"" | |
- work-command: | |
workType: echopayload | |
command: bash | |
params: "-c \"while read -r line; do echo ${line^^}; sleep 5; done\"" |
This file contains hidden or 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
--- | |
- name: Hello Events | |
hosts: localhost | |
sources: | |
- ansible.eda.file_watch: | |
path: /tmp/testing/ | |
recursive: false | |
rules: | |
- name: debug output | |
condition: event.type == "FileModifiedEvent" | |
action: | |
print_event: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment