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

Tried to wrap some todos #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smitthakkar96
Copy link
Member

  • Modified the code to create fstat user before we start everything
  • Added task to create fstat user
  • Added task to create virtualenv and pull/clone fstat code
  • Added task to install dependencies if requirements file is updated

- Modified the code to create fstat user before we start everything
- Added task to create fstat user
- Added task to create virtualenv and pull/clone fstat code
- Added task to install dependencies if requirements file is updated
@smitthakkar96
Copy link
Member Author

@mscherer what should we set in selinux policy permissive/enforcing/disabled

@@ -1,17 +1,35 @@
---
- user: name={{user}}
sudo: yes
Copy link
Contributor

Choose a reason for hiding this comment

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

The sudo is not needed, the playbook is executed as root.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I would prefer to use full yaml form (ie, name: rather than name=)

- name: Install required packages
package:
yum:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep package, so the role is portable (like, on Fedora that use dnf)

file: path=/fstat/code state=directory

- name: create virtualenv if it does not exists
command: virtualenv /fstat/venv
Copy link
Contributor

Choose a reason for hiding this comment

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

This command will be run each time, I think that's suboptimal, shouldn't it verify that ?

# and selinux boolean

- name: create fstat directory
file: path=/fstat/code state=directory
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use full yaml style here too.

@smitthakkar96
Copy link
Member Author

@mscherer is it ok now or do we need any other changes and can you tell me what should we set as selinux boolean?

path: /fstat/code state=directory

- name: Check if virtualenv exists
local_action: stat path=/fstat/venv

Choose a reason for hiding this comment

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

Please use the /fstat/env folder for virtualenv. Otherwise you'll break our current install.

@mscherer
Copy link
Contributor

Seems to be ok, could you squash the change in 1 commit ?

@smitthakkar96
Copy link
Member Author

Sure if I am not wrong github allows you to squash and merge, can you do that?

@mscherer
Copy link
Contributor

We are not using github to merge PR. And rereading the PR, i did see I missed the the part about local_action, gonna comment on it.

path: /fstat/code state=directory

- name: Check if virtualenv exists
local_action: stat path=/fstat/env
Copy link
Contributor

Choose a reason for hiding this comment

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

That is not correct, the local_action is gonna be used on the control system, not on the remote server.

register: env

- name: create virtualenv if it does not exists
command: virtualenv /fstat/env
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

So I think that's not exactly clear on what I meant, but that's using creates: /fstat/venv so the task is not run each time.

@smitthakkar96
Copy link
Member Author

@mscherer can you look at the PR if it is ready I can squash it

register: env

- name: creates virtualenv if it does not exists
command: virtualenv /fstat/env

Choose a reason for hiding this comment

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

Take a look at the creates parameter for the command module. That's what misc asked you to use. It makes the lines 21-24 and 28 redundant.

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.

3 participants