Skip to content

Commit 4b139a9

Browse files
authored
peadm::convert & peadm::upgrade: move steps to own datatypes (#482)
* peadm::convert: move steps to own datatype This makes the whole plan more readable because we don't need multiple lines in the plan. * peadm::upgrade: move steps to own datatype This makes the whole plan more readable because we don't need multiple lines in the plan.
1 parent e17f6b5 commit 4b139a9

File tree

5 files changed

+46
-48
lines changed

5 files changed

+46
-48
lines changed

REFERENCE.md

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@
4343

4444
### Data types
4545

46+
* [`Peadm::ConvertSteps`](#Peadm--ConvertSteps): type for the different steps where the peadm::convert plan can be started
4647
* [`Peadm::Known_hosts`](#Peadm--Known_hosts)
4748
* [`Peadm::Ldap_config`](#Peadm--Ldap_config)
4849
* [`Peadm::Pe_version`](#Peadm--Pe_version)
4950
* [`Peadm::Pem`](#Peadm--Pem)
5051
* [`Peadm::Recovery_opts`](#Peadm--Recovery_opts)
5152
* [`Peadm::SingleTargetSpec`](#Peadm--SingleTargetSpec): A SingleTargetSpec represents any String, Target or single-element array of one or the other that can be passed to get_targets() to return an
53+
* [`Peadm::UpgradeSteps`](#Peadm--UpgradeSteps): type for the different steps where the peadm::upgrade plan can be started
5254

5355
### Tasks
5456

@@ -918,6 +920,12 @@ Data type: `TargetSpec`
918920

919921
## Data types
920922

923+
### <a name="Peadm--ConvertSteps"></a>`Peadm::ConvertSteps`
924+
925+
type for the different steps where the peadm::convert plan can be started
926+
927+
Alias of `Enum['modify-primary-certs', 'modify-infra-certs', 'convert-node-groups', 'finalize']`
928+
921929
### <a name="Peadm--Known_hosts"></a>`Peadm::Known_hosts`
922930

923931
The Peadm::Known_hosts data type.
@@ -1010,6 +1018,12 @@ targets are not.
10101018

10111019
Alias of `Variant[Pattern[/\A[^[:space:],]+\z/], Target, Array[Peadm::SingleTargetSpec, 1, 1]]`
10121020

1021+
### <a name="Peadm--UpgradeSteps"></a>`Peadm::UpgradeSteps`
1022+
1023+
type for the different steps where the peadm::upgrade plan can be started
1024+
1025+
Alias of `Enum['upgrade-primary', 'upgrade-node-groups', 'upgrade-primary-compilers', 'upgrade-replica', 'upgrade-replica-compilers', 'finalize']`
1026+
10131027
## Tasks
10141028

10151029
### <a name="agent_install"></a>`agent_install`
@@ -1826,6 +1840,7 @@ management using PEAdm.
18261840

18271841
The following parameters are available in the `peadm::convert` plan:
18281842

1843+
* [`begin_at_step`](#-peadm--convert--begin_at_step)
18291844
* [`primary_host`](#-peadm--convert--primary_host)
18301845
* [`replica_host`](#-peadm--convert--replica_host)
18311846
* [`compiler_hosts`](#-peadm--convert--compiler_hosts)
@@ -1836,7 +1851,14 @@ The following parameters are available in the `peadm::convert` plan:
18361851
* [`internal_compiler_a_pool_address`](#-peadm--convert--internal_compiler_a_pool_address)
18371852
* [`internal_compiler_b_pool_address`](#-peadm--convert--internal_compiler_b_pool_address)
18381853
* [`dns_alt_names`](#-peadm--convert--dns_alt_names)
1839-
* [`begin_at_step`](#-peadm--convert--begin_at_step)
1854+
1855+
##### <a name="-peadm--convert--begin_at_step"></a>`begin_at_step`
1856+
1857+
Data type: `Optional[Peadm::ConvertSteps]`
1858+
1859+
The step where the plan should start. If not set, it will start at the beginning
1860+
1861+
Default value: `undef`
18401862

18411863
##### <a name="-peadm--convert--primary_host"></a>`primary_host`
18421864

@@ -1916,22 +1938,6 @@ Data type: `Array[String]`
19161938

19171939
Default value: `[]`
19181940

1919-
##### <a name="-peadm--convert--begin_at_step"></a>`begin_at_step`
1920-
1921-
Data type:
1922-
1923-
```puppet
1924-
Optional[Enum[
1925-
'modify-primary-certs',
1926-
'modify-infra-certs',
1927-
'convert-node-groups',
1928-
'finalize']]
1929-
```
1930-
1931-
1932-
1933-
Default value: `undef`
1934-
19351941
### <a name="peadm--install"></a>`peadm::install`
19361942

19371943
Install a new PE cluster
@@ -2429,6 +2435,7 @@ The following parameters are available in the `peadm::upgrade` plan:
24292435
* [`r10k_known_hosts`](#-peadm--upgrade--r10k_known_hosts)
24302436
* [`stagingdir`](#-peadm--upgrade--stagingdir)
24312437
* [`uploaddir`](#-peadm--upgrade--uploaddir)
2438+
* [`begin_at_step`](#-peadm--upgrade--begin_at_step)
24322439
* [`primary_host`](#-peadm--upgrade--primary_host)
24332440
* [`replica_host`](#-peadm--upgrade--replica_host)
24342441
* [`compiler_hosts`](#-peadm--upgrade--compiler_hosts)
@@ -2438,7 +2445,6 @@ The following parameters are available in the `peadm::upgrade` plan:
24382445
* [`token_file`](#-peadm--upgrade--token_file)
24392446
* [`download_mode`](#-peadm--upgrade--download_mode)
24402447
* [`permit_unsafe_versions`](#-peadm--upgrade--permit_unsafe_versions)
2441-
* [`begin_at_step`](#-peadm--upgrade--begin_at_step)
24422448

24432449
##### <a name="-peadm--upgrade--compiler_pool_address"></a>`compiler_pool_address`
24442450

@@ -2518,6 +2524,14 @@ for offline usage.
25182524

25192525
Default value: `'/tmp'`
25202526

2527+
##### <a name="-peadm--upgrade--begin_at_step"></a>`begin_at_step`
2528+
2529+
Data type: `Optional[Peadm::UpgradeSteps]`
2530+
2531+
The step where the plan should start. If not set, it will start at the beginning
2532+
2533+
Default value: `undef`
2534+
25212535
##### <a name="-peadm--upgrade--primary_host"></a>`primary_host`
25222536

25232537
Data type: `Peadm::SingleTargetSpec`
@@ -2588,24 +2602,6 @@ Data type: `Boolean`
25882602

25892603
Default value: `false`
25902604

2591-
##### <a name="-peadm--upgrade--begin_at_step"></a>`begin_at_step`
2592-
2593-
Data type:
2594-
2595-
```puppet
2596-
Optional[Enum[
2597-
'upgrade-primary',
2598-
'upgrade-node-groups',
2599-
'upgrade-primary-compilers',
2600-
'upgrade-replica',
2601-
'upgrade-replica-compilers',
2602-
'finalize']]
2603-
```
2604-
2605-
2606-
2607-
Default value: `undef`
2608-
26092605
### <a name="peadm--util--init_db_server"></a>`peadm::util::init_db_server`
26102606

26112607
The peadm::util::init_db_server class.

plans/convert.pp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# This plan sets required certificate extensions on PE nodes, and configures
44
# the required PE node groups to make an existing cluster compatible with
55
# management using PEAdm.
6+
#
7+
# @param begin_at_step The step where the plan should start. If not set, it will start at the beginning
8+
#
69
plan peadm::convert (
710
# Standard
811
Peadm::SingleTargetSpec $primary_host,
@@ -22,11 +25,7 @@
2225
Optional[String] $internal_compiler_b_pool_address = undef,
2326
Array[String] $dns_alt_names = [],
2427

25-
Optional[Enum[
26-
'modify-primary-certs',
27-
'modify-infra-certs',
28-
'convert-node-groups',
29-
'finalize']] $begin_at_step = undef,
28+
Optional[Peadm::ConvertSteps] $begin_at_step = undef,
3029
) {
3130
peadm::assert_supported_bolt_version()
3231

plans/upgrade.pp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# @param uploaddir
3131
# Directory the installer tarball will be uploaded to or expected to be in
3232
# for offline usage.
33+
# @param begin_at_step The step where the plan should start. If not set, it will start at the beginning
3334
#
3435
plan peadm::upgrade (
3536
# Standard
@@ -59,13 +60,7 @@
5960
Enum[direct,bolthost] $download_mode = 'bolthost',
6061
Boolean $permit_unsafe_versions = false,
6162

62-
Optional[Enum[
63-
'upgrade-primary',
64-
'upgrade-node-groups',
65-
'upgrade-primary-compilers',
66-
'upgrade-replica',
67-
'upgrade-replica-compilers',
68-
'finalize']] $begin_at_step = undef,
63+
Optional[Peadm::UpgradeSteps] $begin_at_step = undef,
6964
) {
7065
# Ensure input valid for a supported architecture
7166
$arch = peadm::assert_supported_architecture(

types/convertsteps.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#
2+
# @summary type for the different steps where the peadm::convert plan can be started
3+
#
4+
type Peadm::ConvertSteps = Enum[ 'modify-primary-certs', 'modify-infra-certs', 'convert-node-groups', 'finalize']

types/upgradesteps.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#
2+
# @summary type for the different steps where the peadm::upgrade plan can be started
3+
#
4+
type Peadm::UpgradeSteps = Enum['upgrade-primary', 'upgrade-node-groups', 'upgrade-primary-compilers', 'upgrade-replica', 'upgrade-replica-compilers', 'finalize']

0 commit comments

Comments
 (0)