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

Code for Chapter 11 #283

Closed
fama opened this issue Jun 8, 2020 · 4 comments
Closed

Code for Chapter 11 #283

fama opened this issue Jun 8, 2020 · 4 comments

Comments

@fama
Copy link

fama commented Jun 8, 2020

I love the book and the videos. Would it be possible to upload the code for chapter 11. Copying from the ebook does not work well.

Also, if you build a new server and change the ssh port and default user, the inventory needs to be updated. Is it possible to build the server fully with ansible (changing the ssh port means that the local inventory file needs to be updated and further ansible playbook need to use the new port. What is your recommendation?

@captainwasabi
Copy link

I'm extremely interested in this question as well. The only way I have found is to write a batch script to run the initial playbook that does the change and generates a new inventory file, then runs a second playbook using the new inventory. There is a way to manipulate the in-memory inventory (https://docs.ansible.com/ansible/latest/modules/list_of_inventory_modules.html), but that doesn't generate a new inventory file.

@geerlingguy
Copy link
Owner

@fama - Good suggestion! I've been meaning to try to get all the code from Chapter 10 into this repo, if nothing else so it can be tested via CI.

For your second question, see some possible helpful pages:

@geerlingguy geerlingguy changed the title chapter 10: code for Chapter 10 Code for Chapter 11 Jul 28, 2020
@geerlingguy
Copy link
Owner

(Updating title as chapter 10 is now chapter 11 in the next version of the book.)

@geerlingguy
Copy link
Owner

Thanks again for opening this! Almost all the example code is now in the playbook in this directory: https://github.com/geerlingguy/ansible-for-devops/tree/master/security

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

No branches or pull requests

3 participants