Skip to content

Commit 11b7352

Browse files
committed
update README
Signed-off-by: NilashishC <[email protected]>
1 parent 89ebd8b commit 11b7352

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed

plugins/scaffolder-backend-module-backstage-rhaap/src/actions/createEEDefinition.ts

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ export function createEEDefinitionAction(options: {
388388
ctx.output('eeDefinitionContent', eeDefinition);
389389

390390
// Generate README with instructions
391-
const readmeContent = generateReadme(mergedValues);
391+
const readmeContent = generateReadme(mergedValues, values.publishToSCM);
392392
await fs.writeFile(readmePath, readmeContent);
393393
logger.info(
394394
`[ansible:create:ee-definition] created README.md at ${readmePath}`,
@@ -546,21 +546,33 @@ ${dependenciesContent}`.trimEnd();
546546
return `${content.trimEnd()}\n`;
547547
}
548548

549-
function generateReadme(values: EEDefinitionInput): string {
549+
function generateReadme(
550+
values: EEDefinitionInput,
551+
publishToSCM: boolean,
552+
): string {
550553
const collections = values.collections || [];
551554
const requirements = values.pythonRequirements || [];
552555
const packages = values.systemPackages || [];
553556
const mcpServers = values.mcpServers || [];
554557

555558
return `# Ansible Execution Environment Definition
556559
557-
This directory contains the definition file for an Ansible Execution Environment.
560+
${
561+
publishToSCM
562+
? 'This directory contains the definition file for an Ansible Execution Environment.'
563+
: ''
564+
}
558565
559-
## Files Generated
566+
${publishToSCM ? `## Files Generated` : '## Files available for download'}
560567
561-
- \`${values.eeFileName}.yaml\` - The Execution Environment definition file
562-
- \`template.yaml\` - The software template for Ansible Portal that allows reusing this Execution Environment definition file to create custom ones.
568+
- \`${values.eeFileName}.yaml\` - The Execution Environment definition file.
569+
${
570+
publishToSCM
571+
? `- \`template.yaml\` - The software template for Ansible Portal that allows reusing this Execution Environment definition file to create custom ones.
563572
- \`catalog-info.yaml\` - The Catalog Entity Descriptor file that allows registering this Execution Environment as a catalog component in Ansible Portal.
573+
`
574+
: '- `README.md` - contains instructions on how to build and use the Execution Environment.'
575+
}
564576
565577
## Configuration
566578
@@ -582,6 +594,22 @@ ${collections
582594
.join('\n')}
583595
\`\`\`\n
584596
597+
If one or more collections specified in your Execution Environment definition are to be pulled from Automation Hub (or a custom Galaxy server),
598+
please ensure that those servers are configured in a \`ansible.cfg\` file and included in the EE build.
599+
You can refer to this documentation for more details: [Configure Red Hat automation hub as the primary content source](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/getting_started_with_automation_hub/configure-hub-primary#proc-configure-automation-hub-server-cli)
600+
601+
For reference, here is an example of an \`ansible.cfg\` file that includes the Red Hat Automation Hub server:
602+
603+
\`\`\`yaml
604+
[galaxy]
605+
server_list = automation_hub
606+
607+
[galaxy_server.automation_hub]
608+
url=https://console.redhat.com/api/automation-hub/content/published/
609+
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
610+
token=<SuperSecretToken>
611+
\`\`\`
612+
585613
To include an \`ansible.cfg\` file in your execution environment build specifying additional configuration such as Automation Hub settings, please add the following sections to the generated Execution Environment definition file:
586614
587615
\`\`\`yaml
@@ -624,7 +652,7 @@ ${packages.map(pkg => `- \`${pkg}\``).join('\n')}
624652
To build this Execution Environment, you need to have the following tools installed:
625653
626654
1. [ansible-builder](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.6/html/creating_and_using_execution_environments/assembly-using-builder)
627-
2. Container Runtime: [Podman](https://www.redhat.com/en/topics/containers/what-is-podman)(recommended) or [Docker](https://www.docker.com/)
655+
2. Container Engine: [Podman](https://podman.io/getting-started/installation) (recommended) or [Docker](https://docs.docker.com/engine/install/)
628656
629657
### Step 2: Build the Execution Environment
630658
@@ -646,10 +674,15 @@ For the full list of supported flags, refer to the
646674
647675
### Step 3: Using the Execution Environment locally
648676
649-
1. Install [\`ansible-navigator\`](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.0-ea/html-single/ansible_navigator_creator_guide/index) using the following command:
650-
\`\`\`bash
651-
pip install ansible-navigator
652-
\`\`\`
677+
1. Install [\`ansible-navigator\`](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.6/html/using_content_navigator/assembly-intro-navigator_ansible-navigator):
678+
679+
\`ansible-navigator\` is a part of Ansible development tools. The can be installed on a container inside VS Code or from a package on RHEL.
680+
681+
Please refer to the following documentations for more details:
682+
683+
[Installing Ansible development tools on a container inside VS Code](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.6/html/using_content_navigator/installing-devtools#devtools-install-container_installing-devtools)
684+
685+
[Installing Ansible development tools from a package on RHEL](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.6/html/using_content_navigator/installing-devtools#devtools-install_installing-devtools)
653686
654687
2. Run your playbook with the built Execution Environment:
655688
\`\`\`bash

0 commit comments

Comments
 (0)