Skip to content

Commit

Permalink
support mono topology for standard installation
Browse files Browse the repository at this point in the history
  • Loading branch information
vchepkov committed Jul 17, 2024
1 parent e0e8aab commit dfd356c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
6 changes: 6 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,12 @@ Data type: `String`

The name of the replica to provision

##### `topology`

Data type: `String`

The topology of PE installation

##### `token_file`

Data type: `Optional[String]`
Expand Down
8 changes: 7 additions & 1 deletion plans/subplans/configure.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# @summary Configure first-time classification and DR setup
#
# @param compiler_pool_address
# @param compiler_pool_address
# The service address used by agents to connect to compilers, or the Puppet
# service. Typically this is a load balancer.
# @param internal_compiler_a_pool_address
Expand Down Expand Up @@ -107,6 +107,11 @@
}

if $arch['disaster-recovery'] {
$topology = $arch['architecture']? {
'standard' => 'mono',
default => 'mono-with-compile',
}

# Run the PE Replica Provision
run_task('peadm::provision_replica', $primary_target,
replica => $replica_target.peadm::certname(),
Expand All @@ -116,6 +121,7 @@
# probably gets "starting", but fails out because that's not "running".
# Can remove flag when that issue is fixed.
legacy => true,
topology => $topology,
)
}

Expand Down
5 changes: 5 additions & 0 deletions tasks/provision_replica.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"type": "String",
"description": "The name of the replica to provision"
},
"topology": {
"type": "String",
"description": "The topology of PE installation",
"default": "mono-with-compile"
},
"token_file": {
"type": "Optional[String]",
"description": "The name of the token-file for auth"
Expand Down
13 changes: 9 additions & 4 deletions tasks/provision_replica.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ else
export TOKEN_FILE="$PT_token_file"
fi

if [ "$PT_topology" = "mono" ] ; then
AGENT_CONFIG=""
else
AGENT_CONFIG="--skip-agent-config"
fi

set -e

Expand All @@ -28,8 +33,8 @@ if [ "$PT_legacy" = "false" ]; then
puppet infrastructure provision replica "$PT_replica" \
--color false \
--yes --token-file "$TOKEN_FILE" \
--skip-agent-config \
--topology mono-with-compile \
$AGENT_CONFIG \
--topology "$PT_topology" \
--enable

elif [ "$PT_legacy" = "true" ]; then
Expand All @@ -45,8 +50,8 @@ elif [ "$PT_legacy" = "true" ]; then
puppet infrastructure enable replica "$PT_replica" \
--color false \
--yes --token-file "$TOKEN_FILE" \
--skip-agent-config \
--topology mono-with-compile
$AGENT_CONFIG \
--topology "$PT_topology"

else
exit 1
Expand Down

0 comments on commit dfd356c

Please sign in to comment.