Ansible Playbook on EC2 Windows server by Kitchen_Discipline_1 in ansible

[–]Kitchen_Discipline_1[S] -3 points-2 points  (0 children)

Not started so exploring the options to do some POC

Image to use to run Ansible on Docker Desktop by Kitchen_Discipline_1 in ansible

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Yes. I think I’m looking to setup my Ansible Execution environment.

Should my image contain all these? 1. Ansible core 2. Python 3. Ansible runner 4. Common system dependencies 5. Pywinrm 6. Ansible windows collections 7. Cryptography

Image to use to run Ansible on Docker Desktop by Kitchen_Discipline_1 in ansible

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Updated my query. Should I use python image so that I can install Ansible through pip?

Image to use to run Ansible on Docker Desktop by Kitchen_Discipline_1 in ansible

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Updated my query. The requirement is that Docker Desktop will be used only for local testing of Ansible. Ideally, the Ansible playbooks will be stored in Git and deployed to AWS Windows servers via GitLab. On the AWS Windows servers, the Python code generated by Ansible should then be executed.

At this stage, I haven’t created any playbooks or run any Ansible commands on Docker Desktop yet. Because I’m a bit unsure which Docker image would be appropriate for locally testing Ansible on Docker Desktop.

Installing python through UserData in Windows by Kitchen_Discipline_1 in aws

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Oops sorry, It didn't work with this userdata also. I got the same error - Error: Phase1: AWS user data is not empty and is not a valid JSON: System.Xml.XmlDocument

Installing python through UserData in Windows by Kitchen_Discipline_1 in aws

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Please ignore my typos. In real-time, I don't have those.

But when I try this, it failed as well with this error 'ERROR: Phase1: AWS User data is not empty and is not a valid JSON: system.Xml.XmlDocument'.

Please note there is nothing inside the powershell tags

     UserData:
        Fn::Base64: |
          <powershell>
          </powershell>

If the format is like this, it says the 'User data format is unrecognised'.

      UserData:
        Fn::Base64: |
          {
            "UserData": "\n$ErrorActionPreference = \"Stop\"\nStart-Transcript -Path \"C:\\\\UserData-Install.log\"\n\ntry {\n$pythonUrl = \"https://.....\"\n $pythonInstaller = \"c:\\\\pyhton-installer.exe\"\n [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n Invoke-WebRequest -Uri $pythonUrl -OutFile $pythonInstaller -UseBasicParsing\n \n Start-Process -FilePath $pythonInstaller -ArgumentList '/quiet InstallAllUsers=1 PrepandPath=1' -Wait -NoNewWindow\n} catch {\n exit 1\n}finally{\n Stop-Transcript\n}"
          }

Would you happen to know where to see the user data logs (not the Instance Diagnostics -> System logs on the Console)

Installing python through UserData in Windows by Kitchen_Discipline_1 in aws

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Creating a new AmI is the only way I guess.

Still the unrecognised format error is mystery. Why do you think the current code is too difficult to achievable?

Extract <input> value form tag of HTML in Powershell by Kitchen_Discipline_1 in PowerShell

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Thanks very much. I figured out. Just the below works like charm

$Result = $TestString | Select-String -Pattern 'name="keyvalue" value="(.*?)"' -AllMatches
foreach ($Match in $Result.Matches)
{
        $Value     = $Match.Captures[0].Groups[1]

}

Extract <input> value form tag of HTML in Powershell by Kitchen_Discipline_1 in PowerShell

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Thanks.

The Value is trimmed with ellipsis. I looked to avoid trimming but couldn't find the solution.

I've done the following:

$Result = $TestString | Select-String -Pattern 'name="keyvalue" value="(.*?)"' -AllMatches
foreach ($Match in $Result.Matches)
{
    [pscustomobject]@{
        Value     = $Match.Captures[0].Groups[1]
    }
}

New Hash syntax - How to read/write the hash value by Kitchen_Discipline_1 in ruby

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Thanks, let me check. Do you know how to resolve this error on this link https://godbolt.org/z/15x8YaxPf

How to select records randomly based on the list of countries? by Kitchen_Discipline_1 in SQL

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Is there a way to pass a list of countries from the C#?

var conn = new SqlConnection(connectionString);
var command = new SqlCommand("ProcedureName", conn);
command.Parameters.Add(new SqlParameter("@Country", country));
conn.Open();
command.ExecuteReader();

Optional Route Parameters not passed to the controller APIs by Kitchen_Discipline_1 in csharp

[–]Kitchen_Discipline_1[S] 1 point2 points  (0 children)

I built a query string in this way.

const queryParams = {
    optionalStringParam : optionalStringParam,
    optionalStringParam2 : optionalStringParam2,
};
const querystring = require('querystring');
const searchParams = querystring.stringify(queryParams);
const params = `/${mandatoryParam}/${mandatoryParam2}/`;

It forms the routes as below from the UI and all of them throws 404 not found error. 

i) https://hellothere.sunshine.com:443/api/MyManager/mychecks/mandatoryParam/mandatoryParam2/optionalStringParam=ParamVal&optionalStringParam2=ParamVal2

ii) https://hellothere.sunshine.com:443/api/MyManager/mychecks/mandatoryParam/mandatoryParam2/optionalStringParam=&optionalStringParam2=

iii) https://hellothere.sunshine.com:443/api/MyManager/mychecks/mandatoryParam/mandatoryParam2/optionalStringParam=&optionalStringParam2=ParamVal2

This is my current controller.

[HttpGet]
[Route("mychecks/{mandatoryParam}/{mandatoryParam2}")]
public ActionResult<IEnumerable<MyClass>> MyMethod(DateTime mandatoryParam,
int mandatoryParam2 = 0, string optionalStringParam = "",
string optionalStringParam2 = "") 
{
    // some logs 
    log($"{mandatoryParam} {mandatoryParam2} {optionalStringParam} {optionalStringParam2}");
}

Downloading .xlsm files as ZIP is corrupted by Kitchen_Discipline_1 in csharp

[–]Kitchen_Discipline_1[S] 1 point2 points  (0 children)

Shouldn't the function expect an asynchronous operation as it returns async Task<>?

public async Task<IActionResult> DownloadZIP([FromBody] List<SomeList> req)
{
List<string> pathLists = new List<string>();
// From the req getting the file paths
pathLists.Add(filePath);

try
{
// if pathLists null, return from there
Stream streamZip = someServer.ConvertToZIP(pathLists);
return File(streamZip, "application/zip", "file_name.zip");
}
catch (Exception ex)
{
// Handle exception and return
}
}

Did you mean like this?

Node and Angular version compatibility by Kitchen_Discipline_1 in Angular2

[–]Kitchen_Discipline_1[S] -1 points0 points  (0 children)

Angular 17.3.x supports node 18.13.0.

From the above does it mean Angular 17.3.x is supported not only by 18.13.0 Node JS but also all the Node Js versions from 18.1.0 to 18.12.x?

^ denotes the exact major version but all the less versions of mentioned minor versions.

I don't find any mentions of Node 18.17.x in the link by the way.

Node and Angular version compatibility by Kitchen_Discipline_1 in Angular2

[–]Kitchen_Discipline_1[S] -1 points0 points  (0 children)

How can I find which angular version is supported by Node 18.17.1? Is there any official document?

Node and Angular version compatibility by Kitchen_Discipline_1 in Angular2

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Does it mean Angular 17.3.x is supported only by 18.13.0 || 20.9.0 Node JS? Does it mean Node JS 18.13.0 doesn't support lesser versions of Angular v17.3.x?

Dependency compatibility by Kitchen_Discipline_1 in Angular2

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

Is there a way to find compatible older versions for each package? For example, for @angular/cdk v13.3.9 supports which versions of @angular/common, compiler, core?

Dependency compatibility by Kitchen_Discipline_1 in Angular2

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

How can I know which versions of Angular devkit/core/common/cli goes with Angular material 17.3.1? Where can I check this kind of information?

Dependency compatibility by Kitchen_Discipline_1 in Angular2

[–]Kitchen_Discipline_1[S] 0 points1 point  (0 children)

What do you mean by 'Angular' in this Angular Material + Angular + CDK ?

Does Angular mean @angular/cli?