Skip to content

Commit

Permalink
Fix ansible-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Oct 31, 2023
1 parent 502dbaa commit ec289ab
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .config/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ skip_list:
- meta-no-info # meta/main.yml should contain relevant info.
- latest[git] # Result of the command may vary on subsequent runs.
- no-handler # Tasks that run when changed should likely be handlers.
- no-changed-when # Commands should not change things if nothing needs doing.
exclude_paths:
- roles/aws_setup_credentials/ # Skip defaults/main.yml file
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
ansible.builtin.import_role:
name: cloud.aws_ops.clone_on_prem_vm
vars:
clone_on_prem_vm_source_vm_name: "{{ clone_on_prem_vm_source_vm_name }}"
clone_on_prem_vm_image_name: "{{ clone_on_prem_vm_image_name }}"
clone_on_prem_vm_uri: "{{ clone_on_prem_vm_uri }}"
clone_on_prem_vm_local_image_path: "{{ clone_on_prem_vm_local_image_path }}"
clone_on_prem_vm_overwrite: "{{ clone_on_prem_vm_overwrite }}"
clone_on_prem_vm_source_vm_name: "{{ source_vm_name }}"
clone_on_prem_vm_image_name: "{{ image_name }}"
clone_on_prem_vm_uri: "{{ uri }}"
clone_on_prem_vm_local_image_path: "{{ local_image_path }}"
clone_on_prem_vm_overwrite: "{{ overwrite }}"
delegate_to: kvm

- name: Import 'cloud.aws_ops.import_image_and_run_aws_instance' role
ansible.builtin.import_role:
name: cloud.aws_ops.import_image_and_run_aws_instance
vars:
import_image_and_run_aws_instance_bucket_name: "{{ import_image_and_run_aws_instance_bucket_name }}"
import_image_and_run_aws_instance_image_path: "{{ clone_on_prem_vm_raw_image_path }}"
import_image_and_run_aws_instance_instance_name: "{{ import_image_and_run_aws_instance_instance_name }}"
import_image_and_run_aws_instance_instance_type: "{{ import_image_and_run_aws_instance_instance_type }}"
import_image_and_run_aws_instance_import_image_task_name: "{{ import_image_and_run_aws_instance_import_image_task_name }}"
import_image_and_run_aws_instances_keypair_name: "{{ import_image_and_run_aws_instances_keypair_name }}"
import_image_and_run_aws_instance_security_groups: "{{ import_image_and_run_aws_instance_security_groups }}"
import_image_and_run_aws_instance_vpc_subnet_id: "{{ import_image_and_run_aws_instance_vpc_subnet_id }}"
import_image_and_run_aws_instance_volumes: "{{ import_image_and_run_aws_instance_volumes }}"
import_image_and_run_aws_instance_bucket_name: "{{ bucket_name }}"
import_image_and_run_aws_instance_image_path: "{{ raw_image_path }}"
import_image_and_run_aws_instance_instance_name: "{{ instance_name }}"
import_image_and_run_aws_instance_instance_type: "{{ instance_type }}"
import_image_and_run_aws_instance_import_image_task_name: "{{ import_image_task_name }}"
import_image_and_run_aws_instance_keypair_name: "{{ keypair_name }}"
import_image_and_run_aws_instance_security_groups: "{{ security_groups }}"
import_image_and_run_aws_instance_vpc_subnet_id: "{{ vpc_subnet_id }}"
import_image_and_run_aws_instance_volumes: "{{ volumes }}"
2 changes: 1 addition & 1 deletion playbooks/webapp/webapp_ha_aurora.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: webapp HA
- name: Webapp HA
hosts: localhost
gather_facts: false
vars_files:
Expand Down
12 changes: 6 additions & 6 deletions roles/clone_on_prem_vm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
manager: auto
register: package_facts

- name: qemu is not installed
debug:
- name: Qemu is not installed
ansible.builtin.debug:
msg: "qemu is not installed"
when: "'qemu' not in package_facts.ansible_facts.packages"

- name: qemu-img is not installed
debug:
- name: Qemu-img is not installed
ansible.builtin.debug:
msg: "qemu-img is not installed"
when: "'qemu-img' not in package_facts.ansible_facts.packages"

Expand Down Expand Up @@ -79,7 +79,7 @@
clone_on_prem_vm__clone_path: "{{ clone_on_prem_vm__tmpdir.path }}/{{ clone_on_prem_vm_image_name }}.qcow2"
clone_on_prem_vm__raw_image_path: "{{ clone_on_prem_vm__tmpdir.path }}/{{ clone_on_prem_vm_image_name }}.raw"

- name: Cloning {{ clone_on_prem_vm_source_vm_name }} on prem VM
- name: Cloning on prem VM {{ clone_on_prem_vm_source_vm_name }}
ansible.builtin.command: |
virt-clone --original {{ clone_on_prem_vm_source_vm_name }} \
--name {{ clone_on_prem_vm_image_name }} \
Expand All @@ -100,7 +100,7 @@
{{ clone_on_prem_vm__clone_path }} \
{{ clone_on_prem_vm__raw_image_path }}
become: true
become_method: sudo
become_method: ansible.builtin.sudo
environment:
LIBVIRT_DEFAULT_URI: "{{ clone_on_prem_vm_uri }}"
when: clone_on_prem_vm__clone_info.stat.exists and clone_on_prem_vm__clone_info.stat.pw_name == "root"
Expand Down
2 changes: 1 addition & 1 deletion roles/import_image_and_run_aws_instance/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
when: import_image_and_run_aws_instance_import_image_task_name is undefined

- name: Get information about the S3 bucket
community.aws.s3_bucket_info:
amazon.aws.s3_bucket_info:
name: "{{ import_image_and_run_aws_instance_bucket_name }}"
register: import_image_and_run_aws_instance__bucket_info

Expand Down

0 comments on commit ec289ab

Please sign in to comment.