O'Reilly logo

Ansible Configuration Management - Second Edition by Daniel Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Environment variables

Often, Unix commands take advantage of certain environment variables. Prevalent examples of this are C makefiles, installers, and the AWS command-line tools. Fortunately, Ansible makes this really easy. If you want to upload a file on the remote machine to Amazon S3, you can set the Amazon access key as follows. You will also see that we install EPEL so that we can install pip, and pip is used to install the AWS tools.

--- - name: Upload a remote file via S3 hosts: ansibletest user: root tasks: - name: Setup EPEL command: > rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/ epel-release-6-8.noarch.rpm creates=/etc/yum.repos.d/epel.repo - name: Install pip yum: name: python-pip state: installed - name: Install the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required