#ansible - April 2020

ansibleArchived
10 messages

Discussions related to ansible configuration management

Abel Luck
Abel Luckover 6 years ago
Does anyone know how to use the ec2_instance ansible module to create an instance with an nvme root volume with a custom size?
Abel Luck
Abel Luckover 6 years ago
This is using t3.* instances
Abel Luck
Abel Luckover 6 years ago
No bites?
ikar
ikarover 6 years ago(edited)
   - name: launch new ec2 instances                                            
     local_action: ec2                                                         
                   ...
                   volumes=[ { device_name: "/dev/sda1", volume_size: 16, volume_type: gp2, delete_on_termination: True } ]

this doesn't work?
ikar
ikarover 6 years ago
maybe switch /dev/sda1 with your device name?
ikar
ikarover 6 years ago
^^ @Abel Luck
Abel Luck
Abel Luckover 6 years ago
@ikar haven't gotten back to that client to test it yet, but will soon!
Brij S
Brij Sover 6 years ago
Hi all, I’m attempting to encrypt an s3 bucket and then encrypt all the contents in the bucket given a list of bucket. I’ve got the following
---
- name: "S3 bucket encryption"
  hosts: localhost
  connection: local 
  vars:
    buckets:
      - test
  
  tasks:
  - name: encrypt S3 bucket
    s3_bucket:
      name: "{{ item }}"
      encryption: AES256
      state: present
    with_items: "{{ buckets }}"
    ignore_errors: true

  - name: obtain list of all objects in bucket
    aws_s3:
      bucket: "{{ item }}"
      object: /
      mode: list
    with_items: "{{ buckets }}"
    register: bucket_item_list
    ignore_errors: true

  - name: encrypt all objects in bucket
    aws_s3:
      bucket: "{{ item.item }}"
      object: "{{ item.s3_keys }}"
      src: "{{ item.s3_keys }}"
      encrypt: yes
      encryption_mode: AES256
      mode: put
    with_items: "{{ bucket_item_list.results }}"
    ignore_errors: true

However, the last step results in the following error:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: expected str, bytes or os.PathLike object, not list
fatal: [localhost]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

Any ideas as to why its complaining about a list? I assume the with_items will loop through the list 🤔
Vikram Yerneni
Vikram Yerneniover 6 years ago
Fellas,
Ansible job for Prometheus helm chart with Ingress Annotation is throwing this weird error:
    "stderr_lines": [
        "Error: failed to parse /tmp/my_values_prom.yaml: error converting YAML to JSON: yaml: line 652: did not find expected alphabetic or numeric character"

and this is the line 652:
651.    annotations:
652.       <http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>: 'alb'

Vikram Yerneni
Vikram Yerneniover 6 years ago
Anyone been through this error before??