Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Cómo extraer un archivo variable de S3 en Ansible

Mi requisito es que quiero incluir dinámicamente un archivo variable en mi secuencia de comandos de Ansible. Puedo hacer eso poniendo siguiente en mi tarea ansible:

 - name: Include vars file include_vars: vars/dev.yml - name: Some other task cp: copy something

Lo anterior funciona si mantengo dev.yml en mi directorio vars. Ahora en realidad no quiero poner dev.yml en el directorio, quiero extraerlo de S3 y luego usar la variable en él. Algo como abajo-

 - name: Get dev file s3: bucket: bucket_name object: object_name dest: "dest_directory" ## Here I want the destination to be vars/dev.yml mode: get aws_access_key: "{{ s3.aws_access_key }}" aws_access_key: "{{ s3.aws_secret_key }}" - name: Include vars file include_vars: vars/dev.yml - name: Some other task that uses vars in dev.yml template: render some template using vars in dev.yml and copy to server

Lo anterior en realidad no funcionará. ¿Cómo hago esto?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Gracias Konstantin Suvorov por la ayuda. Solo necesitaba agregar delegate_to en mi tarea.

 - name: Get dev file s3: bucket: bucket_name object: object_name dest: vars/dev.yml mode: get aws_access_key: "{{ s3.aws_access_key }}" aws_access_key: "{{ s3.aws_secret_key }}" delegate_to: localhost - name: Include vars file include_vars: vars/dev.yml
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!