Python boto ? AWS bucket?
-a – module arguments
-m – module
-i inventory name (ec2.py is a dynamic inventory script that retrieves all EC2 hosts from your amazon)
-u – user
s3- AWS module
force=yes – given file will be overwritten with new one
- set to ‘true’/’yes’ to activate privilege escalation.
- set to user with desired privileges — the user you ‘become’, NOT the user you login as. Does NOT imply become: yes, to allow it to be set at host level.
- (at play or task level) overrides the default method set in ansible.cfg, set to sudo/su/pbrun/pfexec/doas/dzdo/ksu
- (at play or task level) permit to use specific flags for the tasks or role. One common use is to change user to nobody when the shell is set to no login. Added in Ansible 2.2.
# Example action to start service httpd, if not running - service: name: httpd state: started # Example action to stop service httpd, if running - service: name: httpd state: stopped
When we execute an ansible playbook by default it will gather facts of operating system first and then execute tasks listed in it.
Its always not required to gather facts & if we have too many hosts it will take more time to execute a playbook.
To mitigate this we need to disable gather facts with “gather_facts” attribute in ansible playbook.
By default gather_facts attributes value is True, to disable it we need to set it as False.
GCE: Google Cloud Engine module
# Example from Ansible Playbooks - copy: src: /srv/myfiles/foo.conf dest: /etc/foo.conf owner: foo group: foo mode: 0644