Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,34 @@ htmlcov/
.coverage
*.cover

# =============================================================================
# Python
# =============================================================================
__pycache__/
*.py[cod]
.venv/
venv/
.pytest_cache/

# =============================================================================
# OpenTofu / Terraform
# =============================================================================
.tofu/
.tofu.lock
.terraform/
.terraform.lock.hcl
*.tfstate
*.tfstate.backup
*.tfvars
*.tfvars.json
*.tfplan
*.tf.json

# =============================================================================
# MAINTAINER: Add language-specific patterns below
# =============================================================================
# Examples:
#
# Python:
# __pycache__/
# *.py[cod]
# .venv/
# venv/
# .pytest_cache/
#
# Node.js:
# node_modules/
# npm-debug.log
Expand Down
17 changes: 17 additions & 0 deletions hello-ansible/hello-ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Hello World
hosts: localhost
connection: local
gather_facts: no
vars:
first_string: "Hello"
second_string: "World"
tasks:
- name: Print first string
ansible.builtin.debug:
msg: "{{ first_string }}"

- name: Print second string
ansible.builtin.debug:
msg: "{{ second_string }}"
...
33 changes: 33 additions & 0 deletions hello-opentofu/hello-opentofu.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
variable "first_string" {
description = "The first string to display"
type = string
default = "Hello"
}

variable "second_string" {
description = "The second string to display"
type = string
default = "World"
}

resource "null_resource" "hello" {
provisioner "local-exec" {
command = "echo '${var.first_string}'"
}
}

resource "null_resource" "world" {
provisioner "local-exec" {
command = "echo '${var.second_string}'"
}
}

output "first_output" {
description = "The first string that was displayed"
value = var.first_string
}

output "second_output" {
description = "The second string that was displayed"
value = var.second_string
}
20 changes: 20 additions & 0 deletions hello-python/hello-python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import argparse

def main():
# Create argument parser to receive command-line arguments from iagctl
parser = argparse.ArgumentParser(description='Python hello world with two string variables')
parser.add_argument('--first_string', type=str, default='Hello',
help='First string to print')
parser.add_argument('--second_string', type=str, default='World',
help='Second string to print')

# Parse the arguments
args = parser.parse_args()

# Print the two strings
print(args.first_string)
print(args.second_string)

if __name__ == "__main__":
main()
113 changes: 113 additions & 0 deletions import.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
repositories:
- name: hello-iagctl
description: Get started with iagctl
url: https://github.com/itential/hello-itential.git
reference: main
tags:
- demo
- iagctl

services:
- name: hello-ansible
type: ansible-playbook
description: Ansible hello world with two string variables
# decorator: hello-ansible-decorator
working-directory: hello-ansible
playbooks:
- hello-ansible.yml
repository: hello-iagctl
tags:
- demo
- ansible
# Optional extra-vars for testing:
# first_string: First string to print (default: "Hello")
# second_string: Second string to print (default: "World")
# target_host: Target host (default: "127.0.0.1")

- name: hello-python
type: python-script
description: Python hello world with two string variables
# decorator: hello-python-decorator
filename: hello-python.py
working-directory: hello-python
repository: hello-iagctl
tags:
- demo
- python
# Optional environment variables for testing:
# first_string: First string to print (default: "Hello")
# second_string: Second string to print (default: "World")

- name: hello-opentofu
type: opentofu-plan
description: OpenTOFU hello world with two string variables
# decorator: hello-opentofu-decorator
working-directory: hello-opentofu
repository: hello-iagctl
tags:
- demo
- opentofu
# Optional variables for testing:
# first_string: First string to print (default: "Hello")
# second_string: Second string to print (default: "World")

# decorators:
# - name: hello-ansible-decorator
# description: "Decorator for hello-ansible playbook with two string variables"
# schema:
# $id: "hello-ansible"
# $schema: "https://json-schema.org/draft/2020-12/schema"
# type: object
# properties:
# target_host:
# type: string
# description: "Target host for Ansible to connect to"
# default: "127.0.0.1"
# first_string:
# type: string
# description: "First string to print"
# default: "Hello"
# second_string:
# type: string
# description: "Second string to print"
# default: "World"
# required: []
# additionalProperties: false

# - name: hello-opentofu-decorator
# description: "Decorator for hello-opentofu with two string variables"
# schema:
# $id: "hello-opentofu"
# $schema: "https://json-schema.org/draft/2020-12/schema"
# type: object
# properties:
# first_string:
# type: string
# description: "First string to print"
# default: "Hello"
# second_string:
# type: string
# description: "Second string to print"
# default: "World"
# required: []
# additionalProperties: false

# - name: hello-python-decorator
# description: "Decorator for hello-python script with two string variables"
# schema:
# $id: "hello-python"
# $schema: "https://json-schema.org/draft/2020-12/schema"
# type: object
# properties:
# first_string:
# type: string
# description: "First string to print"
# default: "Hello"
# second_string:
# type: string
# description: "Second string to print"
# default: "World"
# required: []
# additionalProperties: false
...
Loading