Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible Deployment. #54

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Ansible Deployment. #54

wants to merge 16 commits into from

Conversation

ntodosiychuk
Copy link
Collaborator

@ntodosiychuk ntodosiychuk commented Dec 23, 2016

Added Playbooks for installation system packages and building env.

TODO:

  • Add roles for WebServer and database and icecast2 Server

Reviewer:
@wolendranh

@ntodosiychuk ntodosiychuk changed the title First Step of Ansible Deployment. Ansible Deployment. Dec 28, 2016
@ntodosiychuk ntodosiychuk self-assigned this Dec 28, 2016
Copy link
Owner

@wolendranh wolendranh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check today on clean VM. didn't have a time last few days :(

README.md Outdated
make
make altinstall
[barmaglot]
your_server_ip
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntodosiychuk what should be provided here as server_ip?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to configure local machine add the next:

[barmaglot]
127.0.0.1

In other case add remote server ip.

README.md Outdated
@@ -59,14 +69,14 @@ sudo apt-get install icecast2
(default icecast config is here /etc/icecast2/icecast.xml)


#####Production related
###Production related
Run Ansible Production Playlist
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playlist or playbook?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right )

npm:
path={{ app_dir }}

- name: Building Webpack Dev build
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think build output log files should be added to gitignore

README.md Outdated
(Python related stuff)
###to install project on clean VM:
#####Step 1 — Installing Ansible
Add the Ansible PPA and refresh our system's package index, install the ansible
Copy link
Owner

@wolendranh wolendranh Feb 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our -> your

@ntodosiychuk
Copy link
Collaborator Author

Updated

README.md Outdated
Activate virtual env
10.source env/bin/activate
11.pip install -r requirments.txt
$ sudo vim /etc/ansible/hosts
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw vim is not installed iun clean Ubuntu VM, at least this apllyes for 16.04 LTS. This could be replaced with vi :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or default edit ;)

README.md Outdated
and test connection via ansible:

```
$ ssh root@your_server_ip
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few remarks about this step.

  • It is possible that not all users know their root password. Basically I presume that user with sudo access is enough
  • in case of setting 127.0.0.1 as a [barmaglot] I got UNREACHEBLE error after ping command. This can be fixed by setting
    [barmaglot] 127.0.0.1 ansible_connection=local

I think this is some specific settings if you want to run Ansible locally, but maybe I am wrong :)

README.md Outdated
In case if you do not have Python 3.5:

```
$ cd ansible
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I missed that but we don't have step where you actually clone repo with project. I know that's obvious that any developer should do it , but still

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already added Step #3


tasks:

- name: Install Git
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small issue - you will not be able to install git from ansible playbook because at that moment you should already have git as you clone this repo :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

4. ln -s /usr/bin/nodejs /usr/bin/node
5. ./build_js.sh
$ cd ansible
$ ansible-playbook -s playbooks/system_packages.yml --ask-sudo-pass
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think bin/install_python3_5.sh file that is requires for this playbook is missing from this branch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you are right!

@ntodosiychuk
Copy link
Collaborator Author

@wolendranh
Your fixes is in this PR

@@ -0,0 +1,32 @@
#!/bin/bash
Copy link
Owner

@wolendranh wolendranh Feb 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntodosiychuk btw:I found out that we can completely replace bash with ansible, at least for Python installation:)
I will fill in pull request this week end.
spoiler:D :

    tasks:
      - name: get&unpack Python
        sudo: yes
        sudo_user: "{{ lookup('env', 'USER') }}"
        unarchive:
          src: https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz
          dest: {{ app_dir }}
          remote_src: True

      - name: compile Python
        sudo: yes
        sudo_user: "{{ lookup('env', 'USER') }}"
        command: chdir={{ app_dir }}/Python-3.5.1 {{ item }}
        with_items:
          - ./configure

something in this style

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants