From afd01213fb3025dd4f8f88640b1e4390743bcde9 Mon Sep 17 00:00:00 2001 From: Aldo Lacuku Date: Tue, 25 Jul 2023 11:11:36 +0200 Subject: [PATCH] refactor(playbooks): move playbooks to their own folder Signed-off-by: Aldo Lacuku --- .github/workflows/ansible-lint.yml | 4 +++- README.md | 2 +- .ansible-lint => ansible-playbooks/.ansible-lint | 5 ++--- ansible.cfg => ansible-playbooks/ansible.cfg | 0 bootstrap.yml => ansible-playbooks/bootstrap.yml | 0 clean-up.yml => ansible-playbooks/clean-up.yml | 0 common.yml => ansible-playbooks/common.yml | 0 git-repos.yml => ansible-playbooks/git-repos.yml | 0 {group_vars => ansible-playbooks/group_vars}/all/vars.yml | 1 - main-playbook.yml => ansible-playbooks/main-playbook.yml | 0 {matrix_gen => ansible-playbooks/matrix_gen}/.gitignore | 0 {matrix_gen => ansible-playbooks/matrix_gen}/README.md | 0 {matrix_gen => ansible-playbooks/matrix_gen}/go.mod | 0 {matrix_gen => ansible-playbooks/matrix_gen}/go.sum | 0 {matrix_gen => ansible-playbooks/matrix_gen}/main.go | 0 {roles => ansible-playbooks/roles}/bootstrap/.gitignore | 0 {roles => ansible-playbooks/roles}/bootstrap/tasks/main.yml | 0 .../roles}/bootstrap/templates/ignite-vm.yaml.j2 | 0 .../roles}/bootstrap/templates/inventory.ini.j2 | 0 {roles => ansible-playbooks/roles}/clean_up/tasks/main.yml | 0 {roles => ansible-playbooks/roles}/git_repos/tasks/main.yml | 0 {roles => ansible-playbooks/roles}/scap_open/tasks/main.yml | 0 {roles => ansible-playbooks/roles}/scap_open/vars/main.yml | 0 scap-open.yml => ansible-playbooks/scap-open.yml | 0 requirements.yml | 2 +- 25 files changed, 7 insertions(+), 7 deletions(-) rename .ansible-lint => ansible-playbooks/.ansible-lint (79%) rename ansible.cfg => ansible-playbooks/ansible.cfg (100%) rename bootstrap.yml => ansible-playbooks/bootstrap.yml (100%) rename clean-up.yml => ansible-playbooks/clean-up.yml (100%) rename common.yml => ansible-playbooks/common.yml (100%) rename git-repos.yml => ansible-playbooks/git-repos.yml (100%) rename {group_vars => ansible-playbooks/group_vars}/all/vars.yml (97%) rename main-playbook.yml => ansible-playbooks/main-playbook.yml (100%) rename {matrix_gen => ansible-playbooks/matrix_gen}/.gitignore (100%) rename {matrix_gen => ansible-playbooks/matrix_gen}/README.md (100%) rename {matrix_gen => ansible-playbooks/matrix_gen}/go.mod (100%) rename {matrix_gen => ansible-playbooks/matrix_gen}/go.sum (100%) rename {matrix_gen => ansible-playbooks/matrix_gen}/main.go (100%) rename {roles => ansible-playbooks/roles}/bootstrap/.gitignore (100%) rename {roles => ansible-playbooks/roles}/bootstrap/tasks/main.yml (100%) rename {roles => ansible-playbooks/roles}/bootstrap/templates/ignite-vm.yaml.j2 (100%) rename {roles => ansible-playbooks/roles}/bootstrap/templates/inventory.ini.j2 (100%) rename {roles => ansible-playbooks/roles}/clean_up/tasks/main.yml (100%) rename {roles => ansible-playbooks/roles}/git_repos/tasks/main.yml (100%) rename {roles => ansible-playbooks/roles}/scap_open/tasks/main.yml (100%) rename {roles => ansible-playbooks/roles}/scap_open/vars/main.yml (100%) rename scap-open.yml => ansible-playbooks/scap-open.yml (100%) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 721e97b..d73cb84 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -15,4 +15,6 @@ jobs: - name: Run ansible-lint # replace `main` with any valid ref, or tags like `v6` - uses: ansible/ansible-lint-action@v6.3.0 # the latest version has a bug that do not run in online mode + uses: ansible/ansible-lint-action@v6.3.0 # the latest version has a bug that does not run in online mode + with: + path: "ansible-playbooks/" diff --git a/README.md b/README.md index 0718670..119dc66 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You need to provide the path to the key pair (`ssh_key_path`) and the name of th ## Run tests -From the repository root you can run tests on all machines by typing: +From the `ansible-playbooks` directory you can run tests on all machines by typing: ```bash ansible-playbook main-playbook --ask-become diff --git a/.ansible-lint b/ansible-playbooks/.ansible-lint similarity index 79% rename from .ansible-lint rename to ansible-playbooks/.ansible-lint index 020fc7a..eb8675d 100644 --- a/.ansible-lint +++ b/ansible-playbooks/.ansible-lint @@ -7,10 +7,9 @@ profile: production # min, basic, moderate,safety, shared, production # and not relative to the CWD of execution. CLI arguments passed to the --exclude # option are parsed relative to the CWD of execution. exclude_paths: - - .github/ - .ansible-lint - requirements.yml -# Offline mode enables installation of requirements.yml and schema refreshing +# Offline mode disables installation of requirements.yml and schema refreshing # needed by the community collection -online: true +offline: false diff --git a/ansible.cfg b/ansible-playbooks/ansible.cfg similarity index 100% rename from ansible.cfg rename to ansible-playbooks/ansible.cfg diff --git a/bootstrap.yml b/ansible-playbooks/bootstrap.yml similarity index 100% rename from bootstrap.yml rename to ansible-playbooks/bootstrap.yml diff --git a/clean-up.yml b/ansible-playbooks/clean-up.yml similarity index 100% rename from clean-up.yml rename to ansible-playbooks/clean-up.yml diff --git a/common.yml b/ansible-playbooks/common.yml similarity index 100% rename from common.yml rename to ansible-playbooks/common.yml diff --git a/git-repos.yml b/ansible-playbooks/git-repos.yml similarity index 100% rename from git-repos.yml rename to ansible-playbooks/git-repos.yml diff --git a/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml similarity index 97% rename from group_vars/all/vars.yml rename to ansible-playbooks/group_vars/all/vars.yml index 905eeb3..cf96bfe 100644 --- a/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -38,7 +38,6 @@ machines: - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-x86_64", rootfs: "therealbobo/ubuntu-image:6.3-x86_64", arch: "x86_64"} - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-aarch64", rootfs: "therealbobo/amazonlinux2022-image:5.15-aarch64", arch: "aarch64"} # noqa: yaml[line-length] - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-aarch64", rootfs: "therealbobo/amazonlinux2-image:5.4-aarch64", arch: "aarch64"} - # - {name: "archlinux-4.14", kernel: "therealbobo/archlinux-kernel:4.14-aarch64", rootfs: "therealbobo/archlinux-image:4.14-aarch64", arch: "aarch64"} - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-aarch64", rootfs: "therealbobo/fedora-image:6.2-aarch64", arch: "aarch64"} - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-aarch64", rootfs: "therealbobo/oraclelinux-image:4.14-aarch64", arch: "aarch64"} - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-aarch64", rootfs: "therealbobo/oraclelinux-image:5.15-aarch64", arch: "aarch64"} diff --git a/main-playbook.yml b/ansible-playbooks/main-playbook.yml similarity index 100% rename from main-playbook.yml rename to ansible-playbooks/main-playbook.yml diff --git a/matrix_gen/.gitignore b/ansible-playbooks/matrix_gen/.gitignore similarity index 100% rename from matrix_gen/.gitignore rename to ansible-playbooks/matrix_gen/.gitignore diff --git a/matrix_gen/README.md b/ansible-playbooks/matrix_gen/README.md similarity index 100% rename from matrix_gen/README.md rename to ansible-playbooks/matrix_gen/README.md diff --git a/matrix_gen/go.mod b/ansible-playbooks/matrix_gen/go.mod similarity index 100% rename from matrix_gen/go.mod rename to ansible-playbooks/matrix_gen/go.mod diff --git a/matrix_gen/go.sum b/ansible-playbooks/matrix_gen/go.sum similarity index 100% rename from matrix_gen/go.sum rename to ansible-playbooks/matrix_gen/go.sum diff --git a/matrix_gen/main.go b/ansible-playbooks/matrix_gen/main.go similarity index 100% rename from matrix_gen/main.go rename to ansible-playbooks/matrix_gen/main.go diff --git a/roles/bootstrap/.gitignore b/ansible-playbooks/roles/bootstrap/.gitignore similarity index 100% rename from roles/bootstrap/.gitignore rename to ansible-playbooks/roles/bootstrap/.gitignore diff --git a/roles/bootstrap/tasks/main.yml b/ansible-playbooks/roles/bootstrap/tasks/main.yml similarity index 100% rename from roles/bootstrap/tasks/main.yml rename to ansible-playbooks/roles/bootstrap/tasks/main.yml diff --git a/roles/bootstrap/templates/ignite-vm.yaml.j2 b/ansible-playbooks/roles/bootstrap/templates/ignite-vm.yaml.j2 similarity index 100% rename from roles/bootstrap/templates/ignite-vm.yaml.j2 rename to ansible-playbooks/roles/bootstrap/templates/ignite-vm.yaml.j2 diff --git a/roles/bootstrap/templates/inventory.ini.j2 b/ansible-playbooks/roles/bootstrap/templates/inventory.ini.j2 similarity index 100% rename from roles/bootstrap/templates/inventory.ini.j2 rename to ansible-playbooks/roles/bootstrap/templates/inventory.ini.j2 diff --git a/roles/clean_up/tasks/main.yml b/ansible-playbooks/roles/clean_up/tasks/main.yml similarity index 100% rename from roles/clean_up/tasks/main.yml rename to ansible-playbooks/roles/clean_up/tasks/main.yml diff --git a/roles/git_repos/tasks/main.yml b/ansible-playbooks/roles/git_repos/tasks/main.yml similarity index 100% rename from roles/git_repos/tasks/main.yml rename to ansible-playbooks/roles/git_repos/tasks/main.yml diff --git a/roles/scap_open/tasks/main.yml b/ansible-playbooks/roles/scap_open/tasks/main.yml similarity index 100% rename from roles/scap_open/tasks/main.yml rename to ansible-playbooks/roles/scap_open/tasks/main.yml diff --git a/roles/scap_open/vars/main.yml b/ansible-playbooks/roles/scap_open/vars/main.yml similarity index 100% rename from roles/scap_open/vars/main.yml rename to ansible-playbooks/roles/scap_open/vars/main.yml diff --git a/scap-open.yml b/ansible-playbooks/scap-open.yml similarity index 100% rename from scap-open.yml rename to ansible-playbooks/scap-open.yml diff --git a/requirements.yml b/requirements.yml index 8e165ea..559cece 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,4 +1,4 @@ --- collections: - name: community.docker - - name: community.crypto \ No newline at end of file + - name: community.crypto