From 1a8300fd9fbe2e6f0186ddc5f2de0a390735f996 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 16 Sep 2021 08:51:35 +0300 Subject: fix: add impl to bindings files for new Subplot Sponsored-by: author --- roles/sane_debian_system/subplot.yaml | 16 ++++++++++++---- roles/unix_users/subplot.yaml | 24 ++++++++++++++++++------ subplot/subplot.yaml | 34 +++++++++++++++++++++++++--------- 3 files changed, 55 insertions(+), 19 deletions(-) diff --git a/roles/sane_debian_system/subplot.yaml b/roles/sane_debian_system/subplot.yaml index 9ac1ee3..b7f03cb 100644 --- a/roles/sane_debian_system/subplot.yaml +++ b/roles/sane_debian_system/subplot.yaml @@ -1,11 +1,19 @@ - then: the host has the {package} package installed - function: host_has_package_installed + impl: + python: + function: host_has_package_installed - then: the host has an empty {pathname} directory - function: host_directory_is_empty + impl: + python: + function: host_directory_is_empty - then: the host has hostname {hostname} - function: host_hostname_is + impl: + python: + function: host_hostname_is - then: the host has {hostname} in /etc/hosts for {addr} - function: host_hostname_has_address + impl: + python: + function: host_hostname_has_address diff --git a/roles/unix_users/subplot.yaml b/roles/unix_users/subplot.yaml index bf7c4b9..e495602 100644 --- a/roles/unix_users/subplot.yaml +++ b/roles/unix_users/subplot.yaml @@ -1,17 +1,29 @@ - then: the host has no user {username} - function: host_does_not_have_user + impl: + python: + function: host_does_not_have_user - then: the host has user {username} - function: host_has_user + impl: + python: + function: host_has_user - then: the user {username} on host has encrypted password {password} - function: host_user_has_password + impl: + python: + function: host_user_has_password - then: the user {username} on host has shell {shell} - function: host_user_has_shell + impl: + python: + function: host_user_has_shell - then: the user {username} on host has authorized_keys containing "{substring}" - function: host_user_has_authorized_keys_containing + impl: + python: + function: host_user_has_authorized_keys_containing - then: the user {username} on host is in group {group} - function: host_user_is_in_group + impl: + python: + function: host_user_is_in_group diff --git a/subplot/subplot.yaml b/subplot/subplot.yaml index 5993feb..cf4bd5d 100644 --- a/subplot/subplot.yaml +++ b/subplot/subplot.yaml @@ -1,24 +1,40 @@ - given: a host running Debian - function: create_vm - cleanup: destroy_vm + impl: + python: + function: create_vm + cleanup: destroy_vm - then: I can run /bin/true on the host - function: run_true_on_host + impl: + python: + function: run_true_on_host - when: I use role {role} - function: use_role_in_playbook + impl: + python: + function: use_role_in_playbook - when: I use variables from {filename} - function: set_vars_file + impl: + python: + function: set_vars_file - when: I run the playbook - function: run_playbook + impl: + python: + function: run_playbook - when: I try to run the playbook - function: try_playbook + impl: + python: + function: try_playbook - then: the command fails - function: command_fails + impl: + python: + function: command_fails - then: stdout contains "{text:text}" - function: xstdout_contains + impl: + python: + function: xstdout_contains -- cgit v1.2.1