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

Comments #4

Open
santoroj opened this issue Sep 5, 2015 · 4 comments
Open

Comments #4

santoroj opened this issue Sep 5, 2015 · 4 comments
Labels
enhancement New feature or request

Comments

@santoroj
Copy link

santoroj commented Sep 5, 2015

Firstly thanks for the module.

I have a question - would it be possible to have comments spanning multiple lines or be able to add a new line at the start of the comment so that when the lines are added in /etc/sysctl.conf file they are not all crammed together and are more readable.

Example:

  sysctl { 'net.ipv4.conf.default.proxy_arp':
    ensure  => present,
    value   => '0',
    comment => 'Switch off ARP proxying'
  }

 sysctl { 'net.ipv4.tcp_max_orphans':
    ensure  => present,
    value   => '256',
    comment => 'Increase the number of remembered connection requests awaiting acknowledgement from the client'
  }
  sysctl { 'net.ipv4.tcp_max_syn_backlog':
    ensure  => present,
    value   => '4096',
    comment => 'Increase the number of remembered connection requests awaiting acknowledgement from the client'
  }

This is what it currently produces:

# net.ipv4.conf.default.proxy_arp: Switch off ARP proxying
net.ipv4.conf.default.proxy_arp = 0
# net.ipv4.tcp_max_syn_backlog: Increase the number of remembered connection requests awaiting acknowledgement from the client
net.ipv4.tcp_max_syn_backlog = 4096
# net.ipv4.tcp_max_orphans: Increase the number of remembered connection requests awaiting acknowledgement from the client
net.ipv4.tcp_max_orphans = 256

What would be nice is to be able to write the following:

  sysctl { 'net.ipv4.tcp_max_syn_backlog':
    ensure  => present,
    value   => '4096',
    comment => '\n\n Increase the number of remembered connection requests awaiting acknowledgement from the client'
  }

which produces lines in the file as shown:

# net.ipv4.conf.default.proxy_arp: Switch off ARP proxying
net.ipv4.conf.default.proxy_arp = 0

# net.ipv4.tcp_max_syn_backlog: Increase the number of remembered 
#  connection requests awaiting acknowledgement from the client
net.ipv4.tcp_max_syn_backlog = 4096

# net.ipv4.tcp_max_orphans: Increase the number of remembered 
#  connection requests awaiting acknowledgement from the client
net.ipv4.tcp_max_orphans = 256

Thanks

Joe..

@raphink
Copy link
Member

raphink commented Sep 8, 2015

That's an interesting feature, that we might want to code for other augeasproviders as well.

I think though that I'd rather pass an array of comments then:

  sysctl { 'net.ipv4.tcp_max_syn_backlog':
    ensure  => present,
    value   => '4096',
    comment => ['Increase the number of remembered',  'connection requests awaiting acknowledgement from the client'],
  }

@domcleal what do you think?

@raphink raphink added the enhancement New feature or request label Sep 8, 2015
@santoroj
Copy link
Author

santoroj commented Sep 9, 2015

Yes that would be good.
I also need to add new line(s) at the start of the comments to space things out as per the example below, this makes the file more readable.

 sysctl { 'net.ipv4.tcp_max_syn_backlog':
    ensure  => present,
    value   => '4096',
    comment => '\n\n Increase the number of remembered connection requests awaiting acknowledgement from the client'
  }

Thanks

Joe..

@raphink
Copy link
Member

raphink commented Sep 15, 2015

The example you gave initially didn't have newlines in the output. What do you expect those newlines to do?

@santoroj
Copy link
Author

The newlines will help space out the lines in the file.
My example above show what the file will look like if you don't put the newlines in and it makes the file difficult to read
Having newlines at the start of each comment will help to make the file readable.
Hope that helps.
Regards

Joe.

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

No branches or pull requests

2 participants