Skip to content

Latest commit

 

History

History

03-deploy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Ansible Lab #03 - App Deployment

實習重點

Application deployment

  • Source: download tar.gz or git?
  • Binary: download or via package manager?
  • Permission
  • Customized configuration?

Pursue for idempotence

  • Register variables
  • Conditions (when in this example)
  • Handlers (to be discussed later in Lab #05)

Customized configuration

Copy configuration files...

  • as-is
  • variable substitution with Jinja2 template system

Directory layout

See: Ansible official document - Best Practices

用到的 module(s)

  • Network modules / get_url: Downloads files from HTTP, HTTPS, or FTP to node.

  • Files modules / unarchive: Unpacks an archive after (optionally) copying it from the local machine.

  • Commands modules / command: Executes a command on a remote node.

  • Files modules / template: Templates a file out to a remote server.

  • File modules / lineinfile: Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.

  • System modules / service: Manage services.

想接受挑戰嗎?

Pursue for idempotence with handlers:

  • Handler for "reload nginx"
  • Handler for "reload php-fpm"

Full details are to be discussed later in Lab #05.