Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The following configuration attributes can be set on the Node, or in the project

* `ansible-inventory` - Specifies the ansible inventory to use, can define a global inventory file at the project level without requiring setting the same variable for each job. It is also possible to provide an inventory _inline_ to a job. The default is /etc/ansible/hosts.
* `ansible-executable` - The executable to use for node Node Executor. (default /bin/sh)
* `ansible-base-dir-path` - Set ansible base directory path. This can be set project-wide to specify the working directory for Ansible operations.
* `ansible-limit` - Global groups limits can be set at the project level to filter hosts/groups from the Ansible inventory. See http://docs.ansible.com/ansible/intro_patterns.html for syntax help.
* `ansible-vault-path` - Default vault file path to use for Playbook Jobs.
* `ansible-vault-storage-path` - Specifies a [Key Storage Path][] to look up the ansible vault password from. If specified, it will be used instead of the `ansible-vault-path`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,15 @@ public String getConfigFile() {
}

public String getBaseDir() {
String baseDir = null;
if (getJobConf().containsKey(AnsibleDescribable.ANSIBLE_BASE_DIR_PATH)) {
baseDir = (String) jobConf.get(AnsibleDescribable.ANSIBLE_BASE_DIR_PATH);
}
String baseDir;
baseDir = PropertyResolver.resolveProperty(
AnsibleDescribable.ANSIBLE_BASE_DIR_PATH,
null,
getFrameworkProject(),
getFramework(),
getNode(),
getJobConf()
);
Comment on lines 766 to +775
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds project/framework-aware resolution for ansible-base-dir-path via PropertyResolver. There are existing specs for AnsibleRunnerContextBuilder, but none cover getBaseDir() precedence (job vs node vs project vs framework) or variable expansion. Adding a focused unit test for getBaseDir() would help prevent regressions and validate the new project-wide behavior.

Copilot uses AI. Check for mistakes.

if (null != baseDir && baseDir.contains("${")) {
return DataContextUtils.replaceDataReferencesInString(baseDir, getContext().getDataContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public class AnsibleModuleWorkflowStep implements StepPlugin, AnsibleDescribable
builder.property(BECOME_USER_PROP);
builder.property(BECOME_PASSWORD_STORAGE_PROP);

builder.mapping(ANSIBLE_BASE_DIR_PATH,PROJ_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
builder.frameworkMapping(ANSIBLE_BASE_DIR_PATH,FWK_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);

DESC = builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class AnsibleNodeExecutor implements NodeExecutor, AnsibleDescribable, Pr
builder.frameworkMapping(ANSIBLE_WINDOWS_EXECUTABLE,FWK_PROP_PREFIX + ANSIBLE_WINDOWS_EXECUTABLE);
builder.mapping(ANSIBLE_CONFIG_FILE_PATH,PROJ_PROP_PREFIX + ANSIBLE_CONFIG_FILE_PATH);
builder.frameworkMapping(ANSIBLE_CONFIG_FILE_PATH,FWK_PROP_PREFIX + ANSIBLE_CONFIG_FILE_PATH);
builder.mapping(ANSIBLE_BASE_DIR_PATH,PROJ_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
builder.frameworkMapping(ANSIBLE_BASE_DIR_PATH,FWK_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
Comment on lines 63 to +66
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ANSIBLE_BASE_DIR_PATH is being added to the project/framework mappings, but this plugin description does not declare the corresponding BASE_DIR_PROP in its builder.property(...) list. If Rundeck only applies mappings for declared properties (as it appears to do elsewhere in the codebase), this mapping may be ignored and the setting will also not be visible/configurable in the Node Executor UI. Consider adding builder.property(BASE_DIR_PROP) here (or remove the mapping if the Node Executor should not expose base dir at all).

Copilot uses AI. Check for mistakes.
builder.mapping(ANSIBLE_GENERATE_INVENTORY,PROJ_PROP_PREFIX + ANSIBLE_GENERATE_INVENTORY);
builder.frameworkMapping(ANSIBLE_GENERATE_INVENTORY,FWK_PROP_PREFIX + ANSIBLE_GENERATE_INVENTORY);
builder.mapping(ANSIBLE_GENERATE_INVENTORY_NODES_AUTH,PROJ_PROP_PREFIX + ANSIBLE_GENERATE_INVENTORY_NODES_AUTH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class AnsiblePlaybookInlineWorkflowNodeStep implements NodeStepPlugin, An
builder.property(BECOME_USER_PROP);
builder.property(BECOME_PASSWORD_STORAGE_PROP);

builder.mapping(ANSIBLE_BASE_DIR_PATH,PROJ_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
builder.frameworkMapping(ANSIBLE_BASE_DIR_PATH,FWK_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);

DESC=builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class AnsiblePlaybookInlineWorkflowStep implements StepPlugin, AnsibleDes
builder.property(BECOME_PASSWORD_STORAGE_PROP);
builder.property(DISABLE_LIMIT_PROP);

builder.mapping(ANSIBLE_BASE_DIR_PATH,PROJ_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
builder.frameworkMapping(ANSIBLE_BASE_DIR_PATH,FWK_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);

DESC = builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public class AnsiblePlaybookWorflowNodeStep implements NodeStepPlugin, AnsibleDe
builder.property(BECOME_USER_PROP);
builder.property(BECOME_PASSWORD_STORAGE_PROP);

builder.mapping(ANSIBLE_BASE_DIR_PATH,PROJ_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
builder.frameworkMapping(ANSIBLE_BASE_DIR_PATH,FWK_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);

DESC=builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public class AnsiblePlaybookWorkflowStep implements StepPlugin, AnsibleDescribab
builder.property(BECOME_PASSWORD_STORAGE_PROP);
builder.property(DISABLE_LIMIT_PROP);

builder.mapping(ANSIBLE_BASE_DIR_PATH,PROJ_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);
builder.frameworkMapping(ANSIBLE_BASE_DIR_PATH,FWK_PROP_PREFIX + ANSIBLE_BASE_DIR_PATH);

DESC = builder.build();
}

Expand Down
Loading