1
1

More than 3 years have passed since last update.

[Ansible][EC2] ユーザーデータをAnsibleから実行するタスク

Last updated at Posted at 2020-05-20

AWS EC2のユーザーデータをansibleで実行する方法です。もう1回流したいと思うことがあったので、タスクにしました。

- name: run USER_DATA of ec2 instance
  become: true
  shell: USER_DATA=$(set -o pipefail; curl http://169.254.169.254/latest/user-data ) && echo $USER_DATA && eval sudo $USER_DATA
  args:
    executable: /bin/bash
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1