Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 4b88e6a

Browse files
lucidqdreamsanjayajodha
authored andcommitted
Adding in infrastructure patterns.
- GRE - IKE - VPN Across Two Resources - Setup iSCSI
1 parent 3b2fe80 commit 4b88e6a

File tree

751 files changed

+106252
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

751 files changed

+106252
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
param
2+
(
3+
[Parameter(Mandatory=$true,Position=1)]
4+
[String] $TargetRRASIP,
5+
[Parameter(Mandatory=$true,Position=2)]
6+
[String] $TargetIPRange,
7+
[Parameter(Mandatory=$true,Position=3)]
8+
[String] $SourceRRASIP
9+
)
10+
11+
Import-Module remoteaccess
12+
$VerbosePreference="continue"
13+
14+
$S2SName = ($TargetIPRange.Replace('.','')).Replace('/','')
15+
Write-verbose "Creating Tunnel called $S2SName"
16+
17+
$TargetIPRangeMetric = $TargetIPRange + ':100'
18+
19+
Write-verbose "Tunnel EndPoint: $TargetRRASIP"
20+
Write-verbose "Subnet and Metric in Tunnel: $TargetIPRangeMetric"
21+
22+
Write-verbose "Checking Routing Installation"
23+
$RoutingInstallation = get-windowsfeature routing -Verbose
24+
if ($RoutingInstallation.Installed)
25+
{
26+
Write-verbose "Routing Already Installed"
27+
}
28+
else
29+
{
30+
Write-verbose 'Installing Routing'
31+
Install-WindowsFeature Routing -IncludeManagementTools -Confirm:$false
32+
start-sleep 10
33+
$RAService = get-service -name remoteaccess
34+
do {
35+
$RAService = get-service -name remoteaccess
36+
Write-verbose 'Set Automatic Start for RemoateAccess'
37+
Set-Service -Name "remoteaccess" -StartupType Automatic -Confirm:$false -Verbose
38+
Write-verbose 'Start RemoteAccess Service '
39+
Start-Service -Name "remoteaccess" -Confirm:$false -Verbose
40+
start-sleep 10
41+
} while ($RAService.status -ne 'Running')
42+
}
43+
44+
45+
$RRASInstalled = (Get-RemoteAccess).VpnS2SStatus
46+
if ($RRASInstalled -ne 'Installed')
47+
{
48+
write-verbose 'Installing VpnS2S'
49+
Install-RemoteAccess -VpnType VpnS2S
50+
start-sleep 10
51+
}
52+
else
53+
{
54+
write-verbose 'VpnS2S Installed'
55+
}
56+
57+
$exsiting = get-VpnS2SInterface | where-object {$_.name -eq $S2SName}
58+
if ($exsiting.name -eq $S2SName)
59+
{
60+
Write-verbose "Existing Tunnel $S2SName Found, Deleting..."
61+
disconnect-VpnS2SInterface -Name $S2SName -Confirm:$false -Force -Verbose
62+
remove-VpnS2SInterface -Name $S2SName -Confirm:$false -Force -Verbose
63+
}
64+
try
65+
{
66+
Write-verbose "Configuring Tunnel $S2SName"
67+
Add-VpnS2SInterface -Name $S2SName -GreTunnel -SourceIpAddress $SourceRRASIP -Destination $TargetRRASIP -IPv4Subnet $TargetIPRangeMetric -PassThru -verbose
68+
start-sleep 5
69+
$result = get-VpnS2SInterface -name $S2SName -Verbose
70+
Write-verbose "Tunnel Created, Status: $($result.ConnectionState)"
71+
}
72+
catch
73+
{
74+
write-host $error
75+
write-host $error[0].Exception
76+
write-error "An error has occurred creating the S2S interface"
77+
}
78+
Finally
79+
{
80+
write-host "Finally block"
81+
start-sleep 60
82+
$result = get-VpnS2SInterface -name $S2SName -Verbose
83+
write-verbose "Tunnel Status: $($result.ConnectionState)"
84+
}
85+
86+
87+
88+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
"Common Tests - Validate Markdown Files",
3+
"Common Tests - Validate Example Files",
4+
"Common Tests - Validate Module Files",
5+
"Common Tests - Validate Script Files",
6+
"Common Tests - Required Script Analyzer Rules",
7+
"Common Tests - Flagged Script Analyzer Rules",
8+
"Common Tests - New Error-Level Script Analyzer Rules",
9+
"Common Tests - Custom Script Analyzer Rules",
10+
"Common Tests - Validate Example Files To Be Published",
11+
"Common Tests - Validate Markdown Links",
12+
"Common Tests - Relative Path Length",
13+
"Common Tests - Validate Localization"
14+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: no
4+
# dev should be the baseline for reporting
5+
branch: dev
6+
7+
comment:
8+
layout: "reach, diff"
9+
behavior: default
10+
11+
coverage:
12+
range: 50..80
13+
round: down
14+
precision: 0
15+
16+
status:
17+
project:
18+
default:
19+
# Set the overall project code coverage requirement to 70%
20+
target: 70
21+
patch:
22+
default:
23+
# Set the pull request requirement to not regress overall coverage by more than 5%
24+
# and let codecov.io set the goal for the code changed in the patch.
25+
target: auto
26+
threshold: 5
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
If you'd like to contribute to this project, please review the [Contribution Guidelines](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: General question or documentation update
3+
about: If you have a general question or documentation update suggestion around the resource module.
4+
---
5+
<!--
6+
Your feedback and support is greatly appreciated, thanks for contributing!
7+
-->
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Problem with a resource
3+
about: If you have a problem, bug, or enhancement with a resource in this resource module.
4+
---
5+
<!--
6+
Your feedback and support is greatly appreciated, thanks for contributing!
7+
8+
ISSUE TITLE:
9+
Please prefix the issue title with the resource name, e.g.
10+
'ResourceName: Short description of my issue'
11+
12+
ISSUE DESCRIPTION (this template):
13+
Please provide information regarding your issue under each header below.
14+
Write N/A under any headers that do not apply to your issue, or if the
15+
information is not available.
16+
17+
NOTE! Sensitive information should be obfuscated.
18+
19+
PLEASE KEEP THE HEADERS.
20+
21+
You may remove this comment block, and the other comment blocks,
22+
but please keep the headers.
23+
-->
24+
#### Details of the scenario you tried and the problem that is occurring
25+
26+
#### Verbose logs showing the problem
27+
28+
#### Suggested solution to the issue
29+
30+
#### The DSC configuration that is used to reproduce the issue (as detailed as possible)
31+
```powershell
32+
# insert configuration here
33+
```
34+
35+
#### The operating system the target node is running
36+
<!--
37+
Please provide as much as possible about the target node, for example
38+
edition, version, build and language.
39+
On OS with WMF 5.1 the following command can help get this information.
40+
41+
Get-ComputerInfo -Property @(
42+
'OsName',
43+
'OsOperatingSystemSKU',
44+
'OSArchitecture',
45+
'WindowsVersion',
46+
'WindowsBuildLabEx',
47+
'OsLanguage',
48+
'OsMuiLanguages')
49+
-->
50+
51+
#### Version and build of PowerShell the target node is running
52+
<!--
53+
To help with this information, please run this command:
54+
$PSVersionTable
55+
-->
56+
57+
#### Version of the DSC module that was used ('dev' if using current dev branch)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: New resource proposal
3+
about: If you have a new resource proposal that you think should be added to this resource module.
4+
---
5+
<!--
6+
Thank you for contributing and making this resource module better!
7+
8+
ISSUE TITLE:
9+
Please prefix the issue title with a proposed resource name,
10+
e.g. 'NewResourceName: New resource proposal'
11+
12+
ISSUE DESCRIPTION (this template):
13+
Please propose the new resource under each header below.
14+
15+
PLEASE KEEP THE HEADERS, but you may remove this comment block.
16+
-->
17+
### Description
18+
19+
### Proposed properties
20+
21+
### Special considerations or limitations
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
Thanks for submitting a Pull Request (PR) to this project.
3+
Your contribution to this project is greatly appreciated!
4+
5+
Please prefix the PR title with the resource name,
6+
e.g. 'ResourceName: My short description'.
7+
If this is a breaking change, then also prefix the PR title
8+
with 'BREAKING CHANGE:',
9+
e.g. 'BREAKING CHANGE: ResourceName: My short description'.
10+
11+
You may remove this comment block, and the other comment blocks, but please
12+
keep the headers and the task list.
13+
-->
14+
#### Pull Request (PR) description
15+
<!--
16+
Replace this comment block with a description of your PR.
17+
-->
18+
19+
#### This Pull Request (PR) fixes the following issues
20+
<!--
21+
If this PR does not fix an open issue, replace this comment block with None.
22+
If this PR resolves one or more open issues, replace this comment block with
23+
a list the issues using a GitHub closing keyword, e.g.:
24+
- Fixes #123
25+
- Fixes #124
26+
-->
27+
28+
#### Task list
29+
<!--
30+
To aid community reviewers in reviewing and merging your PR, please take
31+
the time to run through the below checklist and make sure your PR has
32+
everything updated as required.
33+
34+
Change to [x] for each task in the task list that applies to your PR.
35+
For those task that don't apply to you PR, leave those as is.
36+
-->
37+
- [ ] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
38+
Entry should say what was changed, and how that affects users (if applicable).
39+
- [ ] Resource documentation added/updated in README.md in the resource folder.
40+
- [ ] Resource parameter descriptions added/updated in schema.mof
41+
and comment-based help.
42+
- [ ] Comment-based help added/updated.
43+
- [ ] Localization strings added/updated in all localization files as appropriate.
44+
- [ ] Examples appropriately added/updated.
45+
- [ ] Unit tests added/updated. See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
46+
- [ ] Integration tests added/updated (where possible). See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
47+
- [ ] New/changed code adheres to [DSC Resource Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md) and [Best Practices](https://github.com/PowerShell/DscResources/blob/master/BestPractices.md).
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
limitPerRun: 30
4+
5+
pulls:
6+
daysUntilStale: 14
7+
daysUntilClose: false
8+
exemptProjects: true
9+
exemptMilestones: true
10+
staleLabel: abandoned
11+
exemptLabels:
12+
- needs review
13+
- on hold
14+
- waiting for CLA pass
15+
16+
markComment: >
17+
Labeling this pull request (PR) as abandoned since it has gone 14 days or more
18+
since the last update. An abandoned PR can be continued by another contributor.
19+
The abandoned label will be removed if work on this PR is taken up again.
20+
21+
issues:
22+
daysUntilStale: 30
23+
daysUntilClose: 40
24+
exemptProjects: true
25+
exemptMilestones: true
26+
staleLabel: stale
27+
exemptLabels:
28+
- bug
29+
- enhancement
30+
- tests
31+
- documentation
32+
- resource proposal
33+
- on hold
34+
35+
markComment: >
36+
This issue has been automatically marked as stale because
37+
it has not had activity from the community in the last 30 days. It will be
38+
closed if no further activity occurs within 10 days. If the issue is labelled
39+
with any of the work labels (e.g bug, enhancement, documentation, or tests)
40+
then the issue will not auto-close.
41+
42+
closeComment: >
43+
This issue has been automatically closed because it is has not had activity
44+
from the community in the last 40 days.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DSCResource.Tests

0 commit comments

Comments
 (0)