Posts

Showing posts with the label ansible

Ansistrano (Ansible + Capistrano): Quick Start

In this post, I am going to try Ansistrano to deploy a file on a web server. (See this post  this post  for detail about Ansible) what is Ansistrano? " ansistrano.deploy and ansistrano.rollback are Ansible roles to easily manage the deployment process for scripting applications such as PHP, Python and Ruby. It's an Ansible port for Capistrano." ( https://github.com/ansistrano/deploy ) install %  ansible-galaxy install ansistrano.deploy ansistrano.rollback create test file % mkdir -p public_html  % echo 'hello' > public_html/index.html  deploy % vim playbook.yml --- - name: deploy code hosts: webservers become: true vars: ansistrano_deploy_from: "{{ playbook_dir }}/public_html/" ansistrano_deploy_to: "/var/www/my-app" ansistrano_keep_releases: 3 ansistrano_deploy_via: "rsync" roles: - ansistrano.deploy See  https://github.com/ansistrano/deploy for the vars to customize as needed. Run the playbook. ...

Ansible: Quick Start - Run from Mac to Install Apache on AWS/EC2

In this post, I am going to use Ansible on mac to install apache web server on an EC2 instance. what is Ansible? Ansible is a configuration management tool of servers. Similar technologies include Chef and Puppet. Two biggest different from these tools are: Ansible is in yaml vs Chef & Puppet are in Ruby Ansible is agentless and executed over ssh install brew install ansible create test server You can use Terraform to create an EC2 instance.  https://web-quickstart.blogspot.com/2021/04/terraform-ec2-instance-with-ssh-setup.html Make sure you can ssh into the server using the private key, like: ssh -i test ec2-user@54.88.121.94 hello world Prepare three files: hosts [webservers] 54.88.121.94 ansible.cfg [defaults] inventory = hosts private_key_file = test remote_user = ec2-user playbook.yml  --- - name: update web servers hosts: webservers tasks: - name: test message debug: msg: "Hello, World!"  and run the ansible-playbook command to display the mess...